R Code.A list of useful R code for Master, PhD and Post Graduate
|
List of R Code Used by E3B Graduate Students |
General tips:
- SET YOUR WORK DIRECTORY WHEN YOU OPEN R
- Session -> Set Working Directory -> Choose Directory
- OR setwd("directory_name")
- Spaces do not need to be added to R codes; they can help improve legibility, but codes can run without them
- DO NOT include a space within a variable name; you can use thisvariable, this_variable, this.variable. etc., but trying to use "this variable" will lead to an error
- Placing a space in the middle of a command (such as setwd () ) will also lead to an error
- Remember to add spaces when labeling figures if needed
- DO NOT include a space within a variable name; you can use thisvariable, this_variable, this.variable. etc., but trying to use "this variable" will lead to an error
- R is case sensitive, so be very careful about capitalization or lower cases when using commands or typing file/variable names
- "<-" and "=" are interchangeable, so if you want to set x as 5, you can type either x<-5 or x=5