So today all of a sudden R does not read my excel files. I made absolutely no change on my computer. My working directory is "C:/Users/Ilias Iliadis/OneDrive/Documents" (i got this with getwd() ).
This is the error message that is displayed: Error in read.xlsx.default("GerBiogas") : File does not exist.
GerBiogas is the file i am trying to load. I am absolutely sure it is in the correct folder and i spell it properly. The file is also in xlsx form. I unistalled and reinstalled R but the problem remains.
Do you have any idea was is going on? All of a sudden i cannot load any of my files.
I am trying to load it with this:
read.xlsx("GerBiogas") i also tried to specify the path: read.xlsx("C:\Users\Ilias Iliadis\OneDrive\Documents\GerBiogas.xlsx")
Again it does not work. I am using R version 4.2.2.
I personally wouldn't use library(xlsx) (which I believe contains your read.xlsx) because it has a java dependency...
I use library(readxl)
Though some functions would perhaps guess the associated extension, if my issue with loading a file into R met up against file not found issues, then I would certainly go with including the extension for the avoidance of doubt.
I guess from your working directory; you are likely a windows user.
When you reported getwd() the slashes were / ; which is common. going the other way without doubling up would not be expected to work... i.e. C:\\Users\xxx yes, C:\Users\xxx no ; but as shows C:/Users/xxx also yes. but I would expect you to have actual error related to that, i.e.
Error: '\U' used without hex digits in character string starting ""C:\U"
best way to deal with I cant load my file as the packaged R function says it doesnt exist, is use R base functions to list the files in your directory; and verify the precise name and existence of the file. i.e. for you