## #MonthOfJulia Day 17: Datasets from R

R has an extensive range of builtin datasets, which are useful for experimenting with the language. The RDatasets package makes many of these available within Julia. We’ll see another way of accessing R’s datasets in a couple of days’ time too. In the meantime though, check out the documentation for RDatasets and then read on below.

As always, the first thing that we need to do is load the package.

We can get a list of the R packages which are supported by RDatasets.

Next we’ll get a list of all datasets supported across all of those R packages. There are a lot of them! Also we see some specific statistics about the number of records and fields in each of them.

Or we can find out what datasets are available from a particular R package.

Finally, the most interesting bit: accessing data from a particular dataset. Below we load up the women dataset from the vcd package.

From these data we learn that the average mass of American women of height 66 inches is around 139 pounds. If you are from a country which uses the Metric system (like me!) then these numbers might seem a little mysterious. Come back in a couple of days and we’ll see how Julia can convert pounds and inches in metres and kilograms.

That’s all for now. Code for today is available on github.