read.csv error zero-length variable name

I was able to read the following csv file into RStudio without difficulty until today when I updated R and Rstudio. Now I get the error below.

RS_fungiDB <- read.csv("/Users/theoneal/Desktop/CIMG_FungiDB_2.csv", header = TRUE, sep=",")

Error in exists(cacheKey, where = .rs.WorkingDataEnv, inherits = FALSE) :
invalid first argument
Error in assign(cacheKey, frame, .rs.CachedDataEnv) :
attempt to use zero-length variable name

What am I doing wrong?


Hi @theokirkland , for read a file you need change the symbol slash (/) with blackslash (\), and put double, like this:

RS_fungiDB <- read.csv("\\Users\\theoneal\\Desktop\\CIMG_FungiDB_2.csv", header = TRUE, sep=",")

Other way is use file.choose() for get a path. Select the file and in the console show the correct path of this file.

Or you can go to 'sessions' in top panel, click on 'working directory' and choose 'source file location' .

Hi @theokirkland
This error is being caused by a bug in the latest release of RStudio. It is being fixed as a matter of urgency. See details here:
It occurs in several different situations (not just when using read.csv()).
There is a suggested temporary workaround in the thread.


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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.