Skip to content

Instantly share code, notes, and snippets.

@tomires
Created December 12, 2016 14:55
Show Gist options
  • Save tomires/f380b3081b509d6a98a21b21bf96a8a3 to your computer and use it in GitHub Desktop.
Save tomires/f380b3081b509d6a98a21b21bf96a8a3 to your computer and use it in GitHub Desktop.
x <- 0 // assign value
help(func) example(func)
list.files() source("file.r")
c(1,2,3) // combine into vector
5:9 // vector 5 to 9
seq(5,9,0.5)
// array indexes start at 1
sentence[c(1, 3)]
names(ranks) <- c("first", "second", "third") // assign references
barplot(vector)
plot(x,y)
matrix(def_value, rows, cols)
dim(vector) <- c(2, 4) // make matrix out of vector
matrix[x,y]
mean(vector) median(vector)
abline(h = mean(limbs))
treasure <- data.frame(weights, prices, types)
treasure[["weights"]]
treasure$prices
read.csv(file)
read.table("infantry.txt", sep="\t", header = TRUE)
merge(x = aaa, y = bbb)
plot(countries$GDP, countries$Piracy)
cor.test(countries$GDP, countries$Piracy)
-> p-value pod 0.05 - statisticky signifikantni
line <- lm(countries$Piracy ~ countries$GDP)
abline(line)
install.packages("ggplot2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment