Publications by aghaynes

Beeswarms instead of histograms

28.06.2018

Histograms are good, density plots are also good. Violin and bean plots too. Recently I had someone ask for a plot where you could see each individual point along a continuum, give the points specific colours based on a second variable (similar to the figure), which deviates somewhat from the typical density type plots. Apparently, they’re call...

1079 sym R (390 sym/1 pcs) 4 img

Rough looking figures from R

04.07.2018

A recent blog post regarding data visualization had some barplots I liked the look of (aesthetically…for research purposes, they wouldn’t be suitable). They look as if they’ve be coloured in with a pencil, rather than having solid blocks of colour… I wondered whether it’s possible with R, and indeed it is. There’s a github project cal...

780 sym

rOpenSci’s drake package

10.07.2018

If you don’t know rOpenSci, then I recommend checking them out. They write a lot of really good packages for R. A relatively new seems to be drake. I’ve not played with it yet, but it looks to be very useful at giving indications about which parts of an analysis are subject to changes, and only rerunning those parts to speed up redoing an ana...

1062 sym 2 img

Coloured output in the R console

12.07.2018

Just a little fun today… the R console isn’t the most interesting of things… text is typically either black or red (assuming default settings in RStudio). There’s a package though called crayon which allows one to change the style of text in terms of colour, background and some font-type settings. It could be an interesting way to spice u...

873 sym R (207 sym/1 pcs) 2 img

“Where to bird” geostats in R

15.08.2018

I just came across a nice little post on acquiring and visualizing geodata in R using the Max Planck Institute of Ornithology as an example. It’s by the rOpenSci guys. Some useful code in there by the look of it… Worth a look… Related To leave a comment for the author, please follow the link and comment on their blog: R – Insights of ...

634 sym 2 img

Estimating Pi

16.10.2018

I came across this post which gives a method to estimate Pi by using a circle, it’s circumscribed square and (lots of) random points within said square. Booth used Stata to estimate Pi, but here’s some R code to do the same thing… x <- 0.5 # center x y <- 0.5 # center y n <- 1000 # nr of pts r <- 0.5 # radius pts <- seq(0, 2 * pi, length.ou...

705 sym R (692 sym/1 pcs)

anytime – dates in R

08.11.2018

I just saw an announcement on R Bloggers about the anytime package. It looks to be a very handy package to convert dates in pretty much any format to Date or POSIX classes, without the need to define the format – it’s guessed by an underlying C++ library. It certainly seems to be flexible… putting in the same date in 8 different formats all...

945 sym R (345 sym/1 pcs)

lmer vs INLA for variance components

24.11.2018

Just for fun, I decided to compare the estimates from lmer and INLA for the variance components of an LMM (this isn’t really something that you would ordinarily do – comparing frequentist and bayesian approaches). The codes are below. A couple of plots are drawn, which show the distribution of the hyperparameters (in this case variances) from...

1190 sym R (208 sym/1 pcs)

Extract data from a PNG/TIFF

05.12.2018

Sometimes it’s useful to be able to extract data from a published figure. If the figure isn’t a vector based format (for which the numeric data is probably still in the file), it’s possible to digitize the image with R, click the points and extract it that way. The digitize package is simple to use for this purpose… If you save the top fi...

987 sym R (369 sym/1 pcs) 4 img

#30DayMapChallenge 2021 Day25 interactive

25.11.2021

A map of the Swiss road network that shows more detail the more one zooms in. library(sf) ## Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1 library(leaflet) library(dplyr) ## ## Attache Paket: 'dplyr' ## Die folgenden Objekte sind maskiert von 'package:stats': ## ## filter, lag ## Die folgenden Objekte sind maskiert von 'package:base': ...

212 sym R (1856 sym/10 pcs)