1
votes

Firstly,

I'm unable to use write_csv() function. I get the below error

Error in function_list[k] : could not find function "write_csv"

I've readr pacakge installed which gives the following warning:

Error in get(Info[i, 1], envir = env) : cannot open file 'C:/Users/kishore/Documents/R/win-library/3.3/rlang/R/rlang.rdb': No such file or directory In addition: Warning message: package ‘readr’ was built under R version 3.3.3 Error: package or namespace load failed for ‘readr’

Second,

when I'm trying to read a .csv or excel file I get the below error

c <- read_excel("C:/Users/kishore/Desktop/c.xlsx")

Error in get(Info[i, 1], envir = env) : cannot open file 'C:/Users/kishore/Documents/R/win-library/3.3/rlang/R/rlang.rdb': No such file or directory

View(c)

Error in View : object 'c' not found

I'm not sure what is the issue please advise

1
You can't just give us your errors, we also have to see your code. In the dark, I might guess that you did not set the correct working directory, but without your code I can't be sure.mmyoung77
What does find.package("rlang") tell you?lukeA
So... install.packages("rlang", "C:/Users/kishore/Documents/R/win-library/3.3")?lukeA
try to reinstall readr. Something is off with your setup.sinQueso
I did something like copying the installation files to the folder where R packages are saved and it worked, .libPaths() is showing the path >[1] "C:/Users/kishore/Documents/R/win-library/3.3" "C:/Program Files/R/R-3.3.2/library" apologies for not correctly formatting my posts.kishore

1 Answers

0
votes

PS: I know that the issue has been resolved. I just want to point you to another solution.

If you have problems with readr package, try using the base functions like read.csv and write.csv from utils package. You dont have to install any new packages.

Example

#Reading a csv
#row.names tells that the 1st row contains the headers
df <- read.csv('/Users/Desktop/sample.csv', row.names=1)

#Writing into a csv
#row.names tells that the 1st row contains the column names
write.csv(df, '/Users/Desktop/sample_copy.csv', row.names=T)