Skip to content
R for the Rest of Us Logo

Setting Up Projects and Importing Data in R

David Keyes David Keyes
August 23rd, 2019

I got an email the other day from someone who is interested in learning R, but has been scared off by what others have told her about it.

Now, learning R is not "basically impossible," of course (if it were, no one would use it, which is most definitely not the case). But this person's email gets at something that more experienced users forget: the learning curve for R is steep.

I was also reminded of this in an email exchange with Ann, another new R user. She wrote: "I wish there was a step by step instruction on how to set up a new project (i.e., everything you need to do before you start running scripts to analyze data, etc.)."

I asked Ann to elaborate on her struggles, and here’s how she responded:

I’m not sure how to explain what I’m looking for regarding new projects. Apologies because I’m still new at this and don’t have the right language! I guess I’m looking for something that guides me through the set up. So, something like:

  1. Open R Studio.

  2. Name and save your project by doing…[hints on project management]

  3. Name and save your file by doing…[hints on file management]

  4. Set working directory by…[this is the one I’m particularly confused by]

  5. Import your file to the global environment.

  6. Load packages you need for this session, such as tidyverse, ggplot, psych, etc.

  7. Read in your csv file.

  8. Examine your data.

I’m sure I have most of this wrong, but this is generally what I’m trying to get better at! Hope that makes sense. Thanks so much for your reply 🙂

I loved Ann’s question because it shows the mundane, yet essential, elements of working in R that stop newcomers from making progress. Since these are issues that I know Ann is not the only one struggling with, I asked if I could make her a video explanation and share it with the world.

If you are like Ann, struggling to think about how to set up your projects and get your data into R, this video is for you. It doesn't cover all of the details for how to do these things (though my Getting Started with R course does), but provides a sort of conceptual overview for how you might think about doing them.

I hope this video is helpful for newcomers to R. If you are a newcomer and are struggling with something, I'd love to help you (and others) out. Please email me your struggles to [email protected] and I may just make a video like this one. Nothing is too basic (the more basic, the better!). Know that if you are struggling, others likely are too.

Changing the perception that R is "basically impossible to learn" is my goal here at R for the Rest of Us. Let's make it a reality!

Let us know what you think by adding a comment below.

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