I don't use R often. Every time I come back to it every few months for some task, I don't remember the basics and less-basics of working with my data, even though I have a rough idea of what I want to do.
rows = read.csv("rows.csv")
# Data is in clipboard
#
s <- "175 78
179 81
199 91" # these are not real tabs
data = read.table(text=s, sep="\t") # optional header={TRUE|FALSE}
# Slice rows
dataset[1:177,]
# Slice columns
dataset[,5:10]
dataset[dataset$y > 2012]
colMeans(dataset)
summary(data)
names(data)
plot(x,y)
barplot(v)
install.packages("corrplot")
# (initvalue, rows, columns)
> matrix(0,3,4)
[,1] [,2] [,3] [,4]
[1,] 0 0 0 0
[2,] 0 0 0 0
[3,] 0 0 0 0
> c(4,3,1)
[1] 4 3 1
> 1:4
[1] 1 2 3 4
> sub(" ", "", "1 716.60")
[1] "1716.60"
Computing and visualizing PCA in R (R Bloggers)
d.pca = prcomp(dataset)
summary(d.pca)
biplot(d.pca)
a <- c(2,5,8,9)
> summary(prices.l45mm.auct)
Min. 1st Qu. Median Mean 3rd Qu. Max.
206.6 237.7 257.5 267.9 271.2 564.8
hist
- Display histogram
strsplit
- Split string on delimiter
strtoi
- String to int