How to find dataset packages that'll work in my version of RStudio (Desktop Version 1.4.1717)

I'm trying to load data sets from the datasets package and keep getting error messages that the sets I'm choosing are not compatible with my version of desktop RStudio which is the latest version, # :1.4.1717.

How can I get a list that will just show data sets that will work in my RStudio version so I'm not playing an endless game of "Go Fish!"?

Thanks!

Lisa,

First, you are confusing the install.packages() and library() functions. The former is used to download packages from the internet and install them in the library on your computer, while the latter is used to load an installed package so you can access its functions and data sets. Think of "install.package()" as the library purchasing a book and putting it on the shelf, and "library()" as checking the book out from the library so you can read it.

Second, there is no package named UKDriverDeaths, which is why installed.packages() failed. UKDriverDeaths is a data set in the {datasets} package, which is already installed in the System Library by default. The {datasets} package is also automatically loaded when you start R, so you do not need to load it using the library() function. You can view that data set just by typing UKDriverDeaths in the console.

If you want to see all of the data sets in the {datasets} package, go to the lower right pane in RStudio and click on the Packages tab. Scroll down to the System Library section and click on datasets (the name, not the box).

Also, the error message was "package 'UKDriverDeaths' is not available for this version of R", but you attribute the problem to RStudio. R (version 4.1) is the programming language and RStudio (1.4.1717) is the development environment for using R.

1 Like

Wow! You made it all so clear. The library book analogy will stick with me easily. I was so confused. Thank you very much!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.