Coding basics

R as a calculator

1000/10
## [1] 100
x<-1000/10
x
## [1] 100

assignment symbol

#Use <- to assign a function to a variable

What’s in a name?

#Can only start with a letter but may contain numbers, _, and .'s. Is case sensitive.

Calling functions

Use of TAB

seq(from=1, to=10, by=1)
##  [1]  1  2  3  4  5  6  7  8  9 10

continuation character, +

seq(from=1, to=10)
##  [1]  1  2  3  4  5  6  7  8  9 10

Printing to screen

y<- seq(from=1, to=10)
y
##  [1]  1  2  3  4  5  6  7  8  9 10