Problem Uploading a .csv File into RStudio


#1

I am having a problem uploading the sport_heights.csv file into my RStudio after numerous attempts.

I have the file locally uploaded (appears in the lower right pane in RStudio as sport_heights.csv)

Here is my R code:

heights <- read.csv('sport_heights.csv')
heights

Here is the error message:

heights <- read.csv('sport_heights.csv') 

Error in file(file, "rt") : cannot open the connection 
In addition: Warning message: In file(file, "rt") :  cannot open file 'sport_heights.csv': 
No such file or directory 

Thank you for your consideration!!!


#2

Check your working directory. It must not be the directory in which sport_heights.csv lives.

You can execute getwd() to reveal working directory. RStudio also reveals it in the top of the Console.


#3

Thank you so much! You saved me a tremendous amount of time. Take care and enjoy the rest of your weekend.

G


#4

If your question has been answered, would you mind marking the solution? That way, someone in the future can come along and easily see what worked for you.

If you’re the OP (as you were in this case), there should be a little box at the bottom of replies that you can click to select that response as your “solution.”

Example from one of my questions, below:


Import '%>% from magrittr package
Use italic in a list
Reorder data table with seleceted rows first
#5

Hey Mara,

Strangely enough, I don’t see the solution button on my reply screen. I noticed that on this particular computer, other options are greyed out. I am very sorry.

Greg


#6

No big deal! I’m just trying to spread the word. :blush: