12.07.2015 Views

R dummies

R dummies

R dummies

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Reading the Package Manual and VignetteAfter you’ve installed and loaded a new package, a good starting point is toread the package manual. The package manual is a collection of all function andother package documentation. You can access the manual in two ways. The firstway is to use the help argument to the library() function:> library(help=fortunes)The second way is to find the manual on the package website. If you pointyour browser window to the CRAN page for the fortunes package (http://cran.rproject.org/web/packages/fortunes/),you’ll notice a link to the manual towardthe bottom of the page (http://cran. r-project.org/web/packages/fortunes/fortunes.pdf).Whichever approach you choose, the result is a PDF document containing thepackage manual.Some package authors also write a vignette, a document that illustrates howto use the package. A vignette typically shows some examples of how to use thefunctions and how to get started. The key thing is that a vignette illustrates how touse the package with R code and output, just like this book.To read the vignette for the fortunes package, try the following:> vignette(“fortunes”)Updating PackagesMost package authors release improvements to their packages from time totime. To ensure you have the latest version, use update.packages():> update.packages()This function connects to CRAN (by default) and checks whether there areupdates for all the packages that you’ve installed on your machine. If there are, itasks you whether you want to update each package and then downloads the codeand installs the new version.If you add update.packages(ask = FALSE), R updates all out-of-date

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!