Show Menu
Cheatography

R statistical software (version 1.0 - 2016/05/06))

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Syntax

Assignment
y <- y
Comment
#
Logical operator
==, !=, <, >, |, &
Mathem­atical operators
+, -, /, *, ^

Strings

 

Format

 

Help

 
help(t­opic)
 
?topic
Search the help system
help.s­ear­ch(­"­top­ic")
Names of all objects in the search list matching the regular expression ”topic”
apropo­s("t­opi­c")
HTML version of help
help.s­tart()
Internal strructure of an R object
str(a)
Show objects in the search path; specify pat="pa­t" to search on a pattern
ls()
str() for each variable in the search path
ls.str()
Shows S3 methods of an object
method­s(o­bject)
Lists all the methods to handle objects of class a
method­s(c­las­s=c­las­s(a))

Coercion and verifi­cation

as.num­eric(), as.cha­rac­ter(), as.dat­a.f­rame(), ...
is.num­eric(), is.cha­rac­ter(), is.dat­a.f­rame(), ...
 

Input and output

 

Object structure

 

Object inform­ation

 

Basic graphics

 

Graphical parameters

 

Lattice graphics

 

ggplot2 graphics

 

______­___­___­___­___­___­___­___­______