ropensci / visdat

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

Error while using vis_dat with diamonds dataset #75

Closed nitingupta2 closed 6 years ago

nitingupta2 commented 6 years ago

Here is the error I get when I use vis_dat with diamonds dataset:

visdat::vis_dat(diamonds) Error in mutate_impl(.data, dots) : Evaluation error: argument must be coercible to non-negative integer. In addition: Warning message: In seq_len(nrow(x)) : first element used of 'length.out' argument

njtierney commented 6 years ago

Thank you for filing this issue!

Just confirming that I get the same error:

visdat::vis_dat(ggplot2::diamonds)
#> Warning in seq_len(nrow(x)): first element used of 'length.out' argument
#> Error in mutate_impl(.data, dots): Evaluation error: argument must be coercible to non-negative integer.

Created on 2018-04-03 by the reprex package (v0.2.0).

njtierney commented 6 years ago

Thank you for reporting this! This was a bug, fixed by using a better way to create a row number column in a dataframe - see this [line here](https://github.com/ropensci/visdat/commit/4878053540fdf551a9725d0b1a487cc0faaf59f7#diff-1b62d1c1d07f967b6ebe9bbd20df1348R10

This should now be fixed:

library(ggplot2)
library(visdat)
packageVersion("visdat")
#> [1] '0.2.4.9000'
vis_dat(diamonds)

Created on 2018-06-07 by the reprex package (v0.2.0).