matyuschenko
4/5/2016 - 3:47 PM

R cheatsheet

R cheatsheet

data = read.table('data.txt', sep=';', dec=',', head=TRUE)
file.show('data.txt')
write.table(file='res.txt', result, sep='\t')

plot(1:20, main='Legend')  #dots for 1-dim data, scatter for 2-dim, set of scatters for 3-dim
legend("topleft", pch=1, legend="Legend")
title(main="New Header")

mean(h, na.rm=TRUE) # mean of vector with missing items
mean(na.omit(h))  # the same
h[is.na(h)] <- mean(h, na.r,=TRUE)  # replace missing with mean