It is difficult to understand why statisticians commonly limit their inquiries to Averages, and do not revel in more comprehensive views. Their souls seem as dull to the charm of variety as that of the native of one of our flat English counties, whose retrospect of Switzerland was that, if its mountains could be thrown into its lakes, two nuisances would be got rid of at once. Francis Galton
The chief difference between atomic vectors and lists is that atomic vectors are homogeneous, while lists can be heterogeneous. There’s one other related object: NULL. NULL is often used to represent the absence of a vector (as opposed to NA which is used to represent the absence of a value in a vector). NULL typically behaves like a vector of length 0.
lgl | int | dbl | chr | list | |
---|---|---|---|---|---|
is_logical() |
x | ||||
is_integer() |
x | ||||
is_double() |
x | ||||
is_numeric() |
x | x | |||
is_character() |
x | ||||
is_atomic() |
x | x | x | x | |
is_list() |
x | ||||
is_vector() |
x | x | x | x | x |
Write out this line of code and then map the full process to get to the output
Input
1:10 + 1:2
Output
#> [1] 2 4 4 6 6 8 8 10 10 12
While understanding and using functions is probably more important. Understanding how lists work and the power of lists is a very important key to becoming a master R programmer.
a <- list(a = 1:3, b = "a string", c = pi, d = list(-1, list(-5, "fish")))
What does this command do?
a[[c(4,2,2)]]
What is the difference between tibbles and data frames?
What is the difference between tibbles and data frames?
options(tibble.print_max = 20, tibble.print_min = 6)
options(tibble.print_max = Inf)
options(tibble.width = Inf)