My files are failed to be saved in the correct directory in R. For example, my working directory is /folder/subfolder
, but when I save files, they are all saved in /folder
. When I use getwd
or reset setwd
to the subfolder
, R shows that I'm in the one I want (/folder/subfolder
). Is there anyone knows why?
I'm saving plots and model output on Mac OS:
setwd("/folder/subfolder")
getwd()
"/folder/subfolder"
list.files()
"group.jpg"
"Stake.htm"
stargazer(model, out = "sampleOutput")
jpeg("sample.jpg")
plot(sample, horiz = F)
dev.off()
list.file()
"group.jpg"
"Stake.htm"
Thanks!