Skip to content
R for the Rest of Us Logo

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

Download the course project using this code:

install.packages("usethis")
library(usethis)
use_course("https://rfor.us/getting-started-materials")

Open the project and look at the files within it.

Note: By default, the project will download and open on your desktop. If you want to change the location, you can use this code (replace the C:/Users/david/Documents with a file path that actually exists on your sytem):

use_course("https://rfor.us/getting-started-materials",
		    destdir = "C:/Users/david/Documents")

Learn More

The RStudio website has a good overview of projects, as does the Teach Data Science website.

If you want to go really deep, there’s a nice video on LinkedIn Learning titled Why should you use projects in RStudio?

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Ben Gunderson

Ben Gunderson

September 11, 2023

Hi David,

This download course code worked on my personal mac, but I'm trying to get it working on my work Windows laptop. It keeps returning this error:

The downloaded binary packages are in
	C:\Users\bgunderson\AppData\Local\Temp\RtmpmQYDJV\downloaded_packages
> library(usethis)
Error: package or namespace load failed for ‘usethis’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘vctrs’

Help me troubleshoot?

Ben Gunderson

Ben Gunderson

September 12, 2023

Forgot to mention: I made sure to update my version already! Saw you mentioned that as a solution in the public version of this course.

Ben Gunderson

Ben Gunderson

September 12, 2023

Please disregard! I just had to install the vctrs package and it worked. :)

David Keyes

David Keyes Founder

September 13, 2023

Glad you figured it out!

Michele Parsons

Michele Parsons

September 15, 2023

When I try to download the course project I keept getting this error message:

use_course("https://rfor.us/getting-started-materials") Error in use_course("https://rfor.us/getting-started-materials") : could not find function "use_course"

Michele Parsons

Michele Parsons

September 15, 2023

Disregard...figured it out.

Samreen Chhabra

Samreen Chhabra

October 5, 2023

Hi David, I'm getting this error while downloading the project: trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/usethis_2.2.2.zip' Content type 'application/zip' length 897217 bytes (876 KB) downloaded 876 KB

When I tried to manually type out the code, I got these: package ‘yaml’ successfully unpacked and MD5 sums checked package ‘usethis’ successfully unpacked and MD5 sums checked

I didn't get any of the 'yes' 'no' absolutely' options mentioned in the video- please help! Thank you!

David Keyes

David Keyes Founder

October 5, 2023

I'm not sure why you didn't get the yes/no messages, but it does seem like the package was installed. Can you please try running these two lines and let me know what happens?

library(usethis)
use_course("https://rfor.us/getting-started-materials")

Samreen Chhabra

Samreen Chhabra

October 6, 2023

Hi David, this code worked! Thank you so much.

Laura Bracun

Laura Bracun

October 29, 2023

Pending approval

I get an error "Error in library(usethis) : there is no package called ‘usethis’", it the file does not want to load for me

Laura Bracun

Laura Bracun

October 29, 2023

Peer certificate cannot be authenticated with given CA certificates: [] SSL certificate problem: certificate has expired, I get this error

David Keyes

David Keyes Founder

October 29, 2023

You almost certainly need to install the usethis package still. Please do this by running this in the console

install.packages("usethis")

If you tried this yesterday and it didn't work (possibly due to the certificate error you posted), please try again today. There were some issues yesterday with installing packages that should be resolved now.

I would like to save the files to a different directory. I see "Prefer a different location? Cancel, try again, and specify destdir" I tried just running destdir 'C:/Users/myname/destination/' but that didn't work. Can you help? How do I "cancel"? Thanks!

David Keyes

David Keyes Founder

November 3, 2023

I'm not sure how you cancel because I've never done this, but the location you're trying to save to in the code you shared almost certainly doesn't exist. You'll need to change C:/Users/myname/destination/ to a real location and then it should work.

Alberto Cabrera

Alberto Cabrera

November 3, 2023

install.packages("usethis") library("usethis") use_course("https:/rforus/getting-started-materials")

I wonder if it would be possible to modify the script so that the materials would be download in at already created directory. In my case "~/Documents/R-books/Getting started with R". I had already created a project jumping ahead the lesson.

David Keyes

David Keyes Founder

November 3, 2023

Yes, you can use the destdir argument to put the project in a different location if you'd like to.

Alberto Cabrera

Alberto Cabrera

November 4, 2023

Thanks for the prompt reply, and the suggestion of using destdir. Unfortunately, I am not familiar with destdir and could not find examples.

Libby Heeren

Libby Heeren Coach

November 6, 2023

destdir is an argument to the use_course() function, so you'd use it like this:

use_course("https:/rforus/getting-started-materials", destdir = "C:/Users/libby/Documents/R for the Rest of Us") (but with your own file path of course!)

Nancy Moeller

Nancy Moeller

January 12, 2024

I am having difficulty installing the example data. My error message is: Warning in install.packages : package ‘usethis’ is not available (for R version 3.4.1)

Is there another way for me to download the necessary files?

David Keyes

David Keyes Founder

January 12, 2024

Unfortunately, you're running a very old version of R. Are you able to update it? If so, this problem should go away.

Benoit Gauthier

Benoit Gauthier

January 15, 2024

Hi, David. Thanks for this exceptional free resource on R. I am attempting to use R on my Chromebook. So far, so good. Just a note that, to successfully install the "usethis" package, I had to issue the following commands first:

sudo apt-get install libssl-dev install.packages("openssl")

I am keeping notes on modules I need to install in addition to your instructions in case this is useful for another student.

Benoit Gauthier

Benoit Gauthier

January 15, 2024

To be clear, these are two separate commands:

sudo apt-get install libssl-dev

install.packages("openssl")

David Keyes

David Keyes Founder

January 15, 2024

Thanks!

Charles Obiorah

Charles Obiorah

February 25, 2024

Hello David, how do I stay on course? I pasted the project link. And my PC took some time to process and I received this back : > install.packages("use this") Warning in install.packages : unable to access index for repository https://cran.rstudio.com/src/contrib: cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES' WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/Obiorah/AppData/Local/R/win-library/4.3’ (as ‘lib’ is unspecified)

David Keyes

David Keyes Founder

February 26, 2024

You can safely ignore the warning about RTools. Were you able to open the new project in spite of this warning?

Charles Obiorah

Charles Obiorah

February 27, 2024

Thank you, David, I just went to rest and started again at another time. Thankfully,, it downloaded. Though I took a while to figure how to key in the options(continuing with the delete of zip file or where to download it to)

pia Wollrab

pia Wollrab

March 5, 2024

what am I supposed to do with that? WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding: ... can not download/open you rproject please help

David Keyes

David Keyes Founder

March 6, 2024

You can safely ignore the warning about RTools.

Cyndhia Ramatchandirane

Cyndhia Ramatchandirane

March 11, 2024

Hello, I have version 4.3.3, but I am getting the following error message:

Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/src/contrib:
  cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :
  package ‘usethis’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Warning in install.packages :
  unable to access index for repository https://cran.rstudio.com/bin/windows/contrib/4.3:
  cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/4.3/PACKAGES'

David Keyes

David Keyes Founder

March 11, 2024

Hmm, I'm not totally sure what's going on here, but I recorded a video with a couple ideas. Let me know if this helps!

Cyndhia Ramatchandirane

Cyndhia Ramatchandirane

March 11, 2024

Thanks David. Global CRAN was selected already. I called IT Support at work and the person I talked to is not sure what the issue is either, but someone else will try to help me tomorrow. I've also Googled it, and it seems some folks with the same issue advocated to uncheck "Use secure download method for HTTP." Seems like a connectivity problem? Will try again tomorrow.

unable to access index for repository https://cran.rstudio.com/src/contrib: cannot open URL 'https://cran.rstudio.com/src/contrib/PACKAGES'

David Keyes

David Keyes Founder

March 12, 2024

Ok, let me know how it goes! If you're still having trouble we can have your R in 3 Months coach jump on a call to help you debug.

Cyndhia Ramatchandirane

Cyndhia Ramatchandirane

March 12, 2024

I have no idea why, but I just tried it again this morning (without IT's help), and the package installed! I haven't changed anything myself since yesterday evening. I had tried it with vpn on and off and had restarted my (work) computer, but yesterday it would not work. Moving forward now!

David Keyes

David Keyes Founder

March 12, 2024

Glad it worked now! You may be surprised to find out how often this experience of trying again on a different day works even for experienced programmers.

Sue Reinert

Sue Reinert

April 7, 2024

When I run the project code it says it was successfully run but I don't see a question about whether to download to the desktop and I can't open the project folder to look at the files in it. I am using R 4.3.3. not R 4.2.2 as the video has it. I have no coding experience whatsoever.

David Keyes

David Keyes Founder

April 8, 2024

Hmm, that's strange. Can you try it again and let me know if you get the same thing?

Sue Reinert

Sue Reinert

April 9, 2024

Thanks, my brother signed up for the course so he could help me and we worked it out today. He had already done a project for me in RStudio and I was using that RStudio for your project -- that was the problem. He helped me set up the course project in a different folder and that worked.

David Keyes

David Keyes Founder

April 9, 2024

Glad you got it figured out!