3

I have some trouble to open Rdata files on Rstudio.

I tried different directory.

I tried the load() function.

I set up the file pathway with setwd().

I made sure that the file pathway did not contain spaces or accent or particular character in it.

I tried the function load(file.choose()).

The file is 8.4 Mb (so not empty).

But it keeps saying:

"Object is not found"

It is downloaded from the internet but when I try load(url()) it says:

"cannot open the connection", however I do have internet connection. It also says "status was 'Couldn't connect to server' ".

Any thoughts ? Any ideas to solve the problem would be greatly appreciated.

1 Answer 1

3

Try using the full path to locate the file.

  1. Locate the file on your computer. Let's assume the location is C:/Downloads/thedata.RData
  2. Check if R sees that this file exists file.exists("C:/Downloads/thedata.RData")
  3. If this returns TRUE then the file is there. Try loading load("C:/Downloads/thedata.RData")
  4. Otherwise if file.exists() is FALSE then the file was not reachable. Try moving it to another place and try again

The error you get is Object not found. This error message doesn't seem to be used within the load() function. It can occur if the file-path is missing the surrounding quotes.

Maybe you forgot to quote the filename?

> load(myfile.RData)

Error in load(myfile.RData) : object 'myfile.RData' not found

> load("myfile.RData")
# Works without error.
Sign up to request clarification or add additional context in comments.

10 Comments

Thank you for your clear answer. I tried your function. Actually is says TRUE, so the file is detected but when I afterwards run the load function, it keeps saying "object is not found". I tried anyhow another place and it is not working.
You said that the file is downloaded from the internet. Can you provide an URL, or is it private?
Also expanded the answer about your error - maybe you forgot to quote the filename? (put it inside " ")
Yes the URL is private, sorry. I actually did not forget to use the quotes.
In that case can you show us the full error message you get?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.