Error loading .RData files

Hello everyone,

I'm receiving this error message after loading .RData file I received from a colleague.

Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file './merged_data.RData', probable reason 'No such file or directory'

This error is in response to this piece of code:

data_dir <- "."

load(file.path(data_dir, "merged_data.RData"), verbose = T)

Initially, I thought it was due to old R version, but I have updated it to R version 3.6.3 and RStudio to Version 1.2.5033. I am also having trouble installing CRAN package but am not sure if these two things are related.

Thank you very much for your help in this. Been bugging me for 2 days now.

It seems that you simply don't have the data in your working directory.
on your R console write getwd() to see the local path to your wd.
also you can type dir() to list the files present there, which should include merged_data.RData for your code to be expected to work.

yep..that was it. thank you kindly!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.