boxuancui / DataExplorer

Automate Data Exploration and Treatment
http://boxuancui.github.io/DataExplorer/
Other
512 stars 88 forks source link

Drop zero-variance columns from PCA #130

Closed stephlocke closed 5 years ago

stephlocke commented 5 years ago

I was encountering errors around d3 (#116 ) and the PCA erroring on the nycflight13 data which I tend to use as a more realistic example in my classes.

Makes d3 script inclusion dynamic

This will enable a workaround for the current pandoc conversion issue by excluding the script from the Rmd if the d3 plot is set to not render. This doesn't fix the full issue but offers a workaround.

create_report(flights,
  config = configure_report(
    add_plot_str = FALSE
  ))

Drop zero-var columns from PCA

DataExplorer was producing a hard to diagnose error when there were columns with zero variance (e.g. nycflights13::flights$year). This change drops any zero variance columns from being included in the PCA analysis.

boxuancui commented 5 years ago

Thank you for doing this! It is really helpful! I will merge this whenever I have time (unit tests, etc.).

boxuancui commented 5 years ago

Fixed #116 and added zero-variance handling. Closing PR.