Monday, June 23, 2014

Data analysis using R - R programming Tutorial ( Part 6 )

Package Documentation

To get an overview of an installed package and its contents,
help(package=package name)
Some packages include a vignette, a file with additional documentation and
examples. To get a list of all vignettes from all installed packages,
vignette()


To see a particular vignette,
vignette("topic")
We don’t need to load the package to look at the contents or vignette, but
we do need to load the package to look at the documentation for a specific
function or to run a demo.



Example - Package Documentation

Suppose we are interested in making a flow chart. After browsing the list of
contributed packages on the R website we decide to use diagram.
First download, install and load the package diagram
> install.packages("diagram")
> library(diagram)
List of functions with brief descriptions in the diagram package
> help(package=diagram)
View the vignette
> vignette("diagram")
Look at the documentation for the function plotmat()
> ?plotmat



Working Directory

When we load/save datasets, load source files or save graphs we will need to
specify the file path. To avoid typing the path every time we can specify a
working directory.
To set the working directory click File>Change dir... or type
setwd(file path)