library(tidyverse)
planets <- tibble(
name = c("Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"),
mass = c(0.33, 4.87, 5.97, 0.642, 1898, 568, 86.8, 102),
length_of_day = c(4222.6, 2802, 24, 24.7, 9.9, 10.7, 17.2, 16.1),
mean_temp = factor(c("positive", "positive", "positive", "negative", "negative", "negative", "negative", "negative"),
levels = c("negative", "positive"), ordered = TRUE),
n_moons = c(0, 0, 1, 2, 95, 146, 28, 16),
ring_system = c(FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE),
surface_pressure = c(0, 92, 1, 0.01, NA, NA, NA, NA)
)
planets# A tibble: 8 × 7
name mass length_of_day mean_temp n_moons ring_system surface_pressure
<chr> <dbl> <dbl> <ord> <dbl> <lgl> <dbl>
1 Mercury 0.33 4223. positive 0 FALSE 0
2 Venus 4.87 2802 positive 0 FALSE 92
3 Earth 5.97 24 positive 1 FALSE 1
4 Mars 0.642 24.7 negative 2 FALSE 0.01
5 Jupiter 1898 9.9 negative 95 TRUE NA
6 Saturn 568 10.7 negative 146 TRUE NA
7 Uranus 86.8 17.2 negative 28 TRUE NA
8 Neptune 102 16.1 negative 16 TRUE NA
nrow(planets)[1] 8
ncol(planets)[1] 7