DublinLearningGroup / dataexpks

This package creates a kickstart rmarkdown document that automatically performs some basic data exploration for the supplied dataset.
MIT License
3 stars 2 forks source link

find_highlevelcount_categorical_variables #29

Closed JustinJDavies closed 6 years ago

JustinJDavies commented 7 years ago

Action: When using mtcars as a test dataset, which has no discrete variables, Run the chunk find_highlevelcount_categorical_variables of skeleton.Rmd

Expected : Chunk outputs a comment that there are no discrete variables, and moves on to the next chunk Actual: Throws error "Error: .cols should be a character/numeric vector or a columns object"

JustinJDavies commented 7 years ago

Suggestion : test for # of a variable type first before trying to do something with it.

ie wrap :

catvar_valuecount_tbl <- data_tbl %>%
    summarise_at(coltype_lst$split$discrete
                ,function(x) length(unique(x))) %>%
    gather('var_name', 'level_count') %>%
    arrange(-level_count)

in an if block

JustinJDavies commented 7 years ago

Also manifests in chunk remove_id_variables

kaybenleroll commented 6 years ago

Closing this issue as fixed by

https://github.com/DublinLearningGroup/dataexpks/commit/d85d5d836b419fb2141344c99d809ae6c09bd047