Tidyverse - mpg dataset - "drv" column data missing

Hi, I have installed and loaded tidyverse package and am working with the mpg dataset. I just noticed that the entire "drv" column data is missing. I have no clue why all the data is shown as "NA". I tried deleting the entire package and reinstalling it, but it didn't help much. Can anyone help me with the issue?

> head(mpg)
  manufacturer model displ year cyl      trans **drv** cty hwy fl   class
1         audi    a4   1.8 1999   4   auto(l5)  NA  18  29  p compact
2         audi    a4   1.8 1999   4 manual(m5)  NA  21  29  p compact
3         audi    a4   2.0 2008   4 manual(m6)  NA  20  31  p compact
4         audi    a4   2.0 2008   4   auto(av)  NA  21  30  p compact
5         audi    a4   2.8 1999   6   auto(l5)  NA  16  26  p compact
6         audi    a4   2.8 1999   6 manual(m5)  NA  18  26  p compact

Thank you :slight_smile:

Did you highlight this manually?

What you should get with the sessionInfo below (aside from platform specifics)

library(ggplot2)
head(mpg)
#> # A tibble: 6 x 11
#>   manufacturer model displ  year   cyl trans      drv     cty   hwy fl    class 
#>   <chr>        <chr> <dbl> <int> <int> <chr>      <chr> <int> <int> <chr> <chr> 
#> 1 audi         a4      1.8  1999     4 auto(l5)   f        18    29 p     compa…
#> 2 audi         a4      1.8  1999     4 manual(m5) f        21    29 p     compa…
#> 3 audi         a4      2    2008     4 manual(m6) f        20    31 p     compa…
#> 4 audi         a4      2    2008     4 auto(av)   f        21    30 p     compa…
#> 5 audi         a4      2.8  1999     6 auto(l5)   f        16    26 p     compa…
#> 6 audi         a4      2.8  1999     6 manual(m5) f        18    26 p     compa…
sessionInfo()
#> R version 4.0.2 (2020-06-22)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Catalina 10.15.7
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] ggplot2_3.3.2
#> 
#> loaded via a namespace (and not attached):
#>  [1] knitr_1.30       magrittr_1.5     tidyselect_1.1.0 munsell_0.5.0   
#>  [5] colorspace_2.0-0 R6_2.5.0         rlang_0.4.8      fansi_0.4.1     
#>  [9] dplyr_1.0.2      stringr_1.4.0    highr_0.8        tools_4.0.2     
#> [13] grid_4.0.2       gtable_0.3.0     xfun_0.19        utf8_1.1.4      
#> [17] cli_2.1.0        withr_2.3.0      htmltools_0.5.0  ellipsis_0.3.1  
#> [21] assertthat_0.2.1 yaml_2.2.1       digest_0.6.27    tibble_3.0.4    
#> [25] lifecycle_0.2.0  crayon_1.3.4     purrr_0.3.4      vctrs_0.3.4     
#> [29] glue_1.4.2       evaluate_0.14    rmarkdown_2.5    stringi_1.5.3   
#> [33] compiler_4.0.2   pillar_1.4.6     generics_0.1.0   scales_1.1.1    
#> [37] pkgconfig_2.0.3

Created on 2020-11-12 by the reprex package (v0.3.0)

yes, I did add the asterisks. I was hoping to bold it but then seems like it didn't work under the code block!

below is the sessioninfo I got if this helps!

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] forcats_0.5.0   stringr_1.4.0   dplyr_1.0.2     purrr_0.3.4     readr_1.3.1    
[6] tidyr_1.1.2     tibble_3.0.3    ggplot2_3.3.2   tidyverse_1.3.0

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0 splines_4.0.2    haven_2.3.1      lattice_0.20-41  colorspace_1.4-1
 [6] vctrs_0.3.4      generics_0.0.2   mgcv_1.8-31      blob_1.2.1       rlang_0.4.7     
[11] pillar_1.4.6     glue_1.4.2       withr_2.3.0      DBI_1.1.0        dbplyr_1.4.4    
[16] modelr_0.1.8     readxl_1.3.1     lifecycle_0.2.0  munsell_0.5.0    gtable_0.3.0    
[21] cellranger_1.1.0 rvest_0.3.6      labeling_0.3     fansi_0.4.1      broom_0.7.1     
[26] Rcpp_1.0.5       backports_1.1.10 scales_1.1.1     jsonlite_1.7.1   farver_2.0.3    
[31] fs_1.5.0         hms_0.5.3        digest_0.6.25    stringi_1.5.3    grid_4.0.2      
[36] cli_2.0.2        tools_4.0.2      magrittr_1.5     crayon_1.3.4     pkgconfig_2.0.3 
[41] ellipsis_0.3.1   Matrix_1.2-18    xml2_1.3.2       reprex_0.3.0     lubridate_1.7.9 
[46] assertthat_0.2.1 httr_1.4.2       rstudioapi_0.11  R6_2.4.1         nlme_3.1-148    
[51] compiler_4.0.2  

Strange. We are on the same setup. I'm on RStudio 1.3.1073. There are a few packages attached via namespace where we differ. You might try update.packages() and then see if there are any other datasets where this occurs.

Thanks! I'll try updating other packages as well. It is strange indeed since it's just one column that I'm missing.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.