'R in action' note0

##Getting help

1
2
3
4
5
6
help.start()  #fire up general help
help("function name") #usage about a function
help(package="package name") #list index of functions and
#datasets in a package
?function name # eq to help("function name")
??string #search for 'string' in docs

packages

1
2
3
4
5
6
installed.packages() #list all installed packages
install.packages() #install a package, if no package name given
#you'll be prompted to select a mirror site and
#then select a package in a list
lib(package name) #load a custom package. If the package is installed by you
#you need to load it tell R to load it first before using it

##file manipulation

1
2
3
4
5
6
getwd() #get current working directory
setwd() #set current working directory. Note the dir path should be given
#as "F:/R/project/somewhere" instead of
#using back slash(used for escaping)
dir.create("path/dir name") #create a dir. But you may find no function
#such as dir.remove() or dir.delete() here :-)

At last, if you find some piece of code in this book not running in wondows version R, you should try it out in unix version before considering it a mistake.