Skip to content

Instantly share code, notes, and snippets.

@prasoonsharma
prasoonsharma / gist:725167
Created December 2, 2010 11:47
Basic plots in R
# DOT PLOT
x <- c(1:100)
y <- x*x
plot(x, y)
# LINE PLOT
x <- c(1:100)
y <- x*x
plot(x, y, type="l")
@prasoonsharma
prasoonsharma / gist:725143
Created December 2, 2010 11:09
Loops and conditions in R
# LOOPS IN R
# For
i <- 1
for(i in 1:10){
print(paste("value of iterator: ", i))
}
# While
i <- 1
@prasoonsharma
prasoonsharma / gist:717887
Created November 27, 2010 13:23
Curriculum for Introduction to R
CURRICULUM FOR INTRODUCTION TO R (DRAFT)
Day 1:
a) Install R
b) Use R as a calculator
Day 2:
a) Getting help
b) Use variables in R
c) Understand atomic data types in R