Skip to content

Instantly share code, notes, and snippets.

@ischurov
Created January 19, 2021 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ischurov/19c8d698a87af3e723e63452a79ffd09 to your computer and use it in GitHub Desktop.
Save ischurov/19c8d698a87af3e723e63452a79ffd09 to your computer and use it in GitHub Desktop.
# Work by Ivan Pozdniakov
# See details: http://math-info.hse.ru/s20/g
2 < 3
2 > 3
2 == 3
some_comparison <- 2 != 3
1:10 > 5
1:10 >= 5
d <- 10:1
d[d >= 4]
2+2
a <- 1:10
c("three", 2, 3)
small_l <- list("three", 1:2)
l2 <- list(small_l, 1:3, `+`, log)
l2[[1]][[2]]
str(l2)
named_l <- list(letters = c("a", "b"), numbers = 1:10)
named_l$letters
a
attr(a, "dim") <- c(2, 5)
b <- 2:9
b[1]
b[2:3]
b
b[c(TRUE, FALSE)]
a[1,]
df <- read.csv("https://goo.gl/v7nvho")
str(df)
df[c(TRUE, FALSE),]
df$Age[df$Age>=18]
df[df$Age >= 18, ]
mean(df$Age)
sd(df$Age)
sqrt(sum((df$Age - mean(df$Age))^2)/(length(df$Age) - 1))
sd(df$Age)
var(df$Age)
hist(df$Age)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment