Last active
April 10, 2020 06:37
-
-
Save nvasilenok/5682846a1d527d3e0ff2ee7a1b2f37d6 to your computer and use it in GitHub Desktop.
HSE-PoliSci-PSMS-Seminar-11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# seminar 11 | |
# please copy and paste this code to your RStudio | |
# in R, vector is a collection of elements of the same type | |
# for example, all elements should be numbers or words | |
# we can think of vector as sample | |
x <- c(2, 2, 6, 21, 7, 0, 8, -0.5, 2, -11) | |
# the function 'c' creates vector | |
x # let's print our vector | |
sort(x) | |
length(x) # the number of elements in a vector | |
min(x) | |
max(x) | |
median(x) | |
summary(x) # descriprive statistics | |
IQR(x) # interquartile range | |
boxplot(x) | |
boxplot(x, col = "salmon") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment