I figured it out... -> session -> set working directory -> files pane location
make sure you are in the active folder in the folder's tab
caveat: see nwerth's comment below
original problem:
here's my code:
trees <-read.nexus("AMD_phylogeny_tree_files_1000.nex")
the file is buried in "Home > Cfiles > AMD_morphology" (i can see the file in the files pane to the right)
how do i change the "read" command to get to that file?
here's the error message i get:
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
cannot open file 'AMD_phylogeny_tree_files_1000.nex': No such file or directory
In my experience, this error only occurs if either the working directory is not set to the correct location or the name of the file within the double quotes is not the same as the actual file name.
For the former type getwd() in the console to verify if the correct location is set as the working directory. For the later press F2 after selecting the file, copy the name and paste it within the double quotes.