Error in setwd("/Users/Default.DESKTOP-L72OCEF/Document/STAM200") :
cannot change working directory
When I type getwd, I get the following back:
getwd
function ()
.Internal(getwd())
<bytecode: 0x00000137266c3738>
<environment: namespace:base>
I'm working on windows 10. I'd really appreciate some help getting this working drive set up so that I can work through my course assignment this weekend!
In Rgetwd() is a function. The command getwd says : Print out the code for the function. In order for a function to "work" it needs the (). try set.seed versus set.seed(123). BTW, set.seed() gives an error.
sorry, that was a typo. I tried it a bunch of times with the directory named "documents", not "document as I typed. I fixed the typo, and it still doesn't work
Assuming a working version of R and RStudio if you issue the command
getwd()
it should tell you what directory (aka "folder") that you are currently using.
For example if I do
getwd()
it comes back and tells me that I am using the directory (folder)
/home/john/RJunk
This is in Linux so the path_name will not be the same as on a Windows machine. It's been a long time since I used Windows but you likely would get something along the lines of
C:/megan/my_holidays/tenerife
Once you know where you are you can work back to where you should be. Go back to C:/megan and see what folders you have.
Alternatively Windows must have a search function! Go to C:/megan and do a search for STAM200. You should get a path there. I am sorry not to be of more help but I have not used Windows in roughly 15 years and have forgotten most of its horrors commands.
Slow and steady. When I run into problems like these, I start to search for and answer, even after using R and RStudio for 15 years and other programs from Before Times, when only mainframes roamed the Earth.
When that happens, I have to force myself to step back and see if I'm looking for an answer to the right question, starting from the top
Can I see this in whatever Windows uses these days for a file browser? Is it a directory and not a file? What kind of file is in it? Can you open the file with another app (is it readable?)
When this is sorted consider using the RStudio menu to create a new project, create a folder data with the data you will be using, install.packages("here") and when you open the project it will open the correct file and no need to setwd(). Then, when you need, say, to open a csv file