Skip to content
R for the Rest of Us Logo

Fundamentals of R

Start a New Project

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

  1. Create a new RStudio project

  2. Download data from https://rfor.us/penguins.

  3. Copy the data into the RStudio project you've created

  4. Create a new R Script file and add code to import your data (refer to the Import Data lesson from Getting Started with R course, if necessary)

  5. Save your R Script file

Heads up! Please make sure to download the data file linked above. If you don't download this file and use the penguins_data.csv file from the Getting Started with R course, you will run into issues.

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

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

Charles Obiorah

Charles Obiorah • March 4, 2024

I am happy to be here. However, I am finding it hard to downloadhttps://rfor.us/penguins I tried using both Chrome and Microsoft Edge to no avail. And I did not block any download purposely. How else can I achieve the download, or receive the file so I can progress please

David Keyes

David Keyes Founder • March 4, 2024

You can also download the file here: https://fundamentalsv2.rfortherestofus.com/penguins.csv

Lisa Ellsworth

Lisa Ellsworth • March 21, 2024

Where can we find the solutions to check work? Thanks!

David Keyes

David Keyes Founder • March 21, 2024

I didn't record a solutions video for this lesson because it is doing the exact same thing as I demonstrate in the video. If you still need help, please let me know.

Judith Pohla

Judith Pohla • March 21, 2024

Hi David. Where do we click to find the solutions? I need help with running my data with read_csv

David Keyes

David Keyes Founder • March 21, 2024

I didn't record a solutions video for this lesson because it is doing the exact same thing as I demonstrate in the video. If you still need help, please let me know.

Sazid Khan

Sazid Khan • May 30, 2024

Pending approval

I can not download data from the given link. Whenever i goes to the link it says " Looks like you've followed a broken link or entered a URL that doesn't exist on this site". What should i do?

David Keyes

David Keyes Founder • May 30, 2024

Sorry about that! Please try again now (I fixed the link).

Sazid Khan

Sazid Khan • May 31, 2024

Pending approval

Fixed, Thanks there!

Steven Meyer

Steven Meyer • August 17, 2024

Successfully downloading penguins.csv: When I entered the URL into Safari, the penguins.csv file showed all the data in .csv format in the browser but did it not default to downloads. (Whereas the video shows in Chrome a file with a spreadsheet-like icon with a .csv extension in downloads).
I selected File-> Save As -> and Safari automatically kept the name "penguins.csv"; then I saved it to my project folder.

David Keyes

David Keyes Founder • August 26, 2024

Thanks for the info!

Raouf Kilada

Raouf Kilada • September 25, 2024

I saved the data after copying the URL. It was saved as an xls not as csv....Suggestions?

Gracielle Higino

Gracielle Higino Coach • September 26, 2024

Hi Raouf! I can't reproduce your error, the file downloads as a *.csv here for me independent of the browser that I use. Can you give more details (maybe send a screenshot or the exact name of the file you're getting, including the extension)?

gene trevino

gene trevino • December 4, 2024

how do i find the solutions ?

David Keyes

David Keyes Founder • December 5, 2024

I just added the solution code for this lesson (see the button in the top right of the Your Turn section). Hope that helps!

gene trevino

gene trevino • December 5, 2024

thanks for the solution. now how do youy save the object penguins ?

David Keyes

David Keyes Founder • December 5, 2024

Please take a look at the Import Data lesson from Getting Started with R. It shows how to do save your object.

Hajira Koeller

Hajira Koeller • March 18, 2025

What is the point of creating both a R script file and a R project file? I understand that R project is a higher level structure and maybe it can pull from outputs of different R script files... please de-mystify.

Hajira Koeller

Hajira Koeller • March 18, 2025

What is the point of creating both a R script file and a R project file? I understand that R project is a higher level structure and maybe it can pull from outputs of different R script files... please de-mystify.

Gracielle Higino

Gracielle Higino Coach • March 18, 2025

Hi Hajira! An R project file (*.RProj) is a special kind of file that connects your whole project together, meaning that it locates your working directory in your computer and understands where the other files are. It makes it easier to navigate between folders and files, and it makes your code more reproducible as it prevents you from using absolute paths. You can just send a compressed folder containing your RProj file and your scripts (sometimes your raw data too) to a collaborator, and they will be able to run your code.

On the other hand, R scripts are blocks of code that are pretty much independent. While you can edit and write on an R script, which is a text file, you can't do that with your RProj file.

Let us know if the difference is still unclear!

Heather Worker

Heather Worker • March 18, 2025

Similar question about the file types and nesting the files that Hajira brought up. Right now I just have my project file (.rproj) and data file (the R script, or .r file) side by side in the same folder that I called "Penguinsheather." 1. Should these go in the "misc" file folders that we downloaded in the learning file template for file organization best practices? 2. based on the description of an R project folder, do I understand correctly that this will not expand to hold data or cold like I visually see a file folder does in windows or Mac--correct (even though it does seem to tie these pieces together?)

Gracielle Higino

Gracielle Higino Coach • March 20, 2025

Hi Heather! We'll discuss a bit about this in the live session, but I'll try to summarise it here:

Ideally your code (*.R files) should be stored in a code folder within your working directory, which is where your *.RProj file lives. For example, if you are working on the lessons "Your Turn" sections, you should probably have an *.RProj file in your misc folder, and the *.R files that you generate through the exercises will live in the code folder within the misc folder. You could potentially have one project for each lesson, as long as you have child folders for each of them inside the misc folder.

Think of a "project directory" as a folder on your computer that contains your data, your data-raw, your code folders and your *.RProj file. As long as you keep this structure, you could nest one project into another, but if you do that, you should avoid at all costs having an *.RProj file in your root misc folder.

You should never have more than one *.RProj file in the same directory. It's not gonna break R, but it will make your workflow very ineffective.

Finally, the *.RProj file is a binary file that you can use to open RStudio and have your working directory set up automatically for you. It does make it easier to navigate through files and folders, but it does not work as a file explorer/finder. We don't really edit this file, or visualize it as a separate thing.

Let us know if it's not clear! 😊