PingjunChen
2/7/2019 - 9:19 PM

R Gist

R Gist

Clear sonsole

Ctrl+l

Set working directory

setwd(dir)

Get working directory

getwd()

Clear environment

remove(list = ls())

How to use a package

install.packages('fortunes') # install
library(fortunes) # load
lsf.str("package:fortunes") # view all functions in package
fortune("This is R") # call

Function help

help(rnorm)

Usage exmpale

example(rnorm)

Run R script

source("foo.R")