Photo by James Eades on Unsplash
tibble
is much like the dataframe
in base R,# A tibble: 4 × 8
species island bill_length_mm bill_depth_mm flipper_l…¹ body_…² sex year
<fct> <fct> <dbl> <dbl> <int> <int> <fct> <int>
1 Adelie Torgersen 39.1 18.7 181 3750 male 2007
2 Adelie Torgersen 39.5 17.4 186 3800 fema… 2007
3 Adelie Torgersen 40.3 18 195 3250 fema… 2007
4 Adelie Torgersen NA NA NA NA <NA> 2007
# … with abbreviated variable names ¹flipper_length_mm, ²body_mass_g
species island bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
1 Adelie Torgersen 39.1 18.7 181 3750
2 Adelie Torgersen 39.5 17.4 186 3800
3 Adelie Torgersen 40.3 18.0 195 3250
4 Adelie Torgersen NA NA NA NA
sex year
1 male 2007
2 female 2007
3 female 2007
4 <NA> 2007
You might see a tibble
prints:
NA
s are highlighted in console so they’re easy to spot (font highlighting and styling in tibble
)Not so much a concern in an R Markdown file, but noticeable in the console
This enhanced print method makes it easier to work with large datasets
There are a couple of other main differences, namely in subsetting and recycling
Check them out in vignette("tibble")