Skip to content

Instantly share code, notes, and snippets.

@PingjunChen
Last active February 8, 2019 03:52
Show Gist options
  • Save PingjunChen/2b74604754792f5879e90b4579a2344d to your computer and use it in GitHub Desktop.
Save PingjunChen/2b74604754792f5879e90b4579a2344d to your computer and use it in GitHub Desktop.
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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment