15.2 Initial setup
First you should set up a folder on your computer to work in, and put the materials for this module into it. There should be this file, plus files called ‘microclim_aust.zip’ and ‘microclim_NAm.zip’. The latter files are compressed files of the microclimate data we will use.
Next, open R-Studio and open a new script. As you go through the prac, you can type (or paste) your R commands into it so you can save them and add additional comments to them (you put a comment in by using the # symbol - any subsequent text is then a comment, and the more comments you add the better!).
Set the working directory to be the folder you created for the prac - use RStudio’s menu: Session/Set Working Directory/Choose Directory…
Alternatively, use the function setwd()
, e.g. setwd('c:/Users/mrke/Desktop/SDM prac 3')
. Note that you need to use forward slashes (or you can use double back slashes, i.e. setwd('c:\\Users\\mrke\\Desktop\\SDM prac 3')
).
As a general point, you can find help on any R command or function by simply typing a question mark and then the command or function’s name, e.g. ?setwd
.