ropensci / visdat

Preliminary Exploratory Visualisation of Data
https://docs.ropensci.org/visdat/
Other
453 stars 47 forks source link

Error: cannot convert object to a data frame #56

Closed alastor2831 closed 7 years ago

alastor2831 commented 7 years ago

Hi. Whenever I try to call either functions I get this error:

vis_dat(airquality)
Error: cannot convert object to a data frame
vis_miss(airquality)
Error: cannot convert object to a data frame

I tried with several different data.frames but always get the same error. What's wrong?

njtierney commented 7 years ago

Hi @nickeatingpizza !

Thanks for posting the issue, sorry to hear you are having this error.

I can't seem to replicate it - running those commands produces this

library(visdat)

vis_dat(airquality)


vis_miss(airquality)

Session info ``` r devtools::session_info() #> Session info ------------------------------------------------------------- #> setting value #> version R version 3.4.1 (2017-06-30) #> system x86_64, darwin15.6.0 #> ui X11 #> language (EN) #> collate en_AU.UTF-8 #> tz Australia/Melbourne #> date 2017-09-15 #> Packages ----------------------------------------------------------------- #> package * version date source #> assertthat 0.2.0 2017-04-11 CRAN (R 3.4.0) #> backports 1.1.0 2017-05-22 cran (@1.1.0) #> base * 3.4.1 2017-07-07 local #> bindr 0.1 2016-11-13 cran (@0.1) #> bindrcpp * 0.2 2017-06-17 CRAN (R 3.4.0) #> bitops 1.0-6 2013-08-17 CRAN (R 3.4.0) #> colorspace 1.3-2 2016-12-14 CRAN (R 3.4.0) #> compiler 3.4.1 2017-07-07 local #> datasets * 3.4.1 2017-07-07 local #> devtools 1.13.3 2017-08-02 CRAN (R 3.4.1) #> digest 0.6.12 2017-01-27 CRAN (R 3.4.0) #> dplyr 0.7.2 2017-07-20 cran (@0.7.2) #> evaluate 0.10.1 2017-06-24 cran (@0.10.1) #> ggplot2 2.2.1 2016-12-30 CRAN (R 3.4.0) #> glue 1.1.1 2017-06-21 cran (@1.1.1) #> graphics * 3.4.1 2017-07-07 local #> grDevices * 3.4.1 2017-07-07 local #> grid 3.4.1 2017-07-07 local #> gtable 0.2.0 2016-02-26 CRAN (R 3.4.0) #> htmltools 0.3.6 2017-04-28 cran (@0.3.6) #> knitr 1.16 2017-05-18 cran (@1.16) #> labeling 0.3 2014-08-23 CRAN (R 3.4.0) #> lazyeval 0.2.0 2016-06-12 CRAN (R 3.4.0) #> magrittr 1.5 2014-11-22 CRAN (R 3.4.0) #> memoise 1.1.0 2017-06-15 Github (hadley/memoise@d63ae9c) #> methods * 3.4.1 2017-07-07 local #> munsell 0.4.3 2016-02-13 CRAN (R 3.4.0) #> pkgconfig 2.0.1 2017-03-21 cran (@2.0.1) #> plyr 1.8.4 2016-06-08 CRAN (R 3.4.0) #> purrr 0.2.3 2017-08-02 CRAN (R 3.4.1) #> R6 2.2.2 2017-06-17 cran (@2.2.2) #> Rcpp 0.12.12 2017-07-15 cran (@0.12.12) #> RCurl 1.95-4.8 2016-03-01 CRAN (R 3.4.0) #> rlang 0.1.2 2017-08-09 CRAN (R 3.4.1) #> rmarkdown 1.6 2017-06-16 Github (rstudio/rmarkdown@ca634d7) #> rprojroot 1.2 2017-01-16 CRAN (R 3.4.0) #> scales 0.4.1.9002 2017-07-11 Github (hadley/scales@6db7b6f) #> stats * 3.4.1 2017-07-07 local #> stringi 1.1.5 2017-04-07 CRAN (R 3.4.0) #> stringr 1.2.0 2017-02-18 CRAN (R 3.4.0) #> tibble 1.3.4 2017-08-22 cran (@1.3.4) #> tidyr 0.7.0 2017-08-16 CRAN (R 3.4.1) #> tidyselect 0.1.1 2017-07-24 CRAN (R 3.4.1) #> tools 3.4.1 2017-07-07 local #> utils * 3.4.1 2017-07-07 local #> visdat * 0.2.1 2017-09-02 local #> withr 2.0.0 2017-07-28 CRAN (R 3.4.1) #> XML 3.98-1.9 2017-06-19 cran (@3.98-1.) #> yaml 2.1.14 2016-11-12 cran (@2.1.14) ```

Do you think you could try running reprex::reprex(visdat::vis_dat(airquality), si = TRUE)?

alastor2831 commented 7 years ago

Hi! Thanks for the reply, I just saw it now. Here's the output of reprex:

visdat::vis_dat(airquality)
#> Error: cannot convert object to a data frame
Session info ``` r devtools::session_info() #> Session info -------------------------------------------------------------- #> setting value #> version R version 3.2.3 (2015-12-10) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate Italian_Italy.1252 #> tz Europe/Berlin #> date 2017-09-25 #> Packages ------------------------------------------------------------------ #> package * version date source #> assertthat 0.2.0 2017-04-11 CRAN (R 3.2.5) #> DBI 0.4-1 2016-05-08 CRAN (R 3.2.5) #> devtools 1.12.0 2016-06-24 CRAN (R 3.2.5) #> digest 0.6.9 2016-01-08 CRAN (R 3.2.3) #> dplyr 0.4.3 2015-09-01 CRAN (R 3.2.5) #> evaluate 0.9 2016-04-29 CRAN (R 3.2.5) #> formatR 1.4 2016-05-09 CRAN (R 3.2.5) #> htmltools 0.3.5 2016-03-21 CRAN (R 3.2.5) #> knitr 1.13 2016-05-09 CRAN (R 3.2.5) #> magrittr 1.5 2014-11-22 CRAN (R 3.2.3) #> memoise 1.0.0 2016-01-29 CRAN (R 3.2.3) #> purrr 0.2.2 2016-06-18 CRAN (R 3.2.5) #> R6 2.1.2 2016-01-26 CRAN (R 3.2.3) #> Rcpp 0.12.5 2016-05-14 CRAN (R 3.2.5) #> rmarkdown 0.9.6 2016-05-01 CRAN (R 3.2.3) #> stringi 1.1.1 2016-05-27 CRAN (R 3.2.5) #> stringr 1.2.0 2017-02-18 CRAN (R 3.2.5) #> visdat 0.1.0 2017-07-11 CRAN (R 3.2.3) #> withr 2.0.0 2017-07-28 CRAN (R 3.2.3) #> yaml 2.1.13 2014-06-12 CRAN (R 3.2.3) ```
njtierney commented 7 years ago

Thanks for that!

Can you try two things,

  1. install tidyverse with install.packages("tidyverse"), and then run tidyverse::tidyverse_update(), then try and run visdat.

  2. update R to the latest version from CRAN (3.4.1)

njtierney commented 7 years ago

Hi @nickeatingpizza !

Are you still having the same problems with visdat? I'm just closing this issue now, but if you are still having problems I'm happy to re-open it :)