janitor

tidyverse: Cross tables of one variable with all other variables in data.frame

独自空忆成欢 提交于 2021-02-07 19:06:56
问题 I want to make cross table of a variable with all other variables in the data.frame. library(tidyverse) library(janitor) humans <- starwars %>% filter(species == "Human") humans %>% janitor::tabyl(gender, eye_color) gender blue blue-gray brown dark hazel yellow female 3 0 5 0 1 0 male 9 1 12 1 1 2 humans %>% dplyr::select_if(is.character) %>% dplyr::select(-name, -gender) %>% purrr::map(.f = ~janitor::tabyl(dat = humans, gender, .x)) Error: Unknown columns `blond`, `none`, `brown`, `brown,

Convert Excel numeric to date

我的未来我决定 提交于 2019-12-10 10:38:18
问题 I have a vector of numeric excel dates i.e. date <- c(42963,42994,42903,42933,42964) The output am I expecting when using excel_to_numeric_date function from janitor package and as.yearmon function from zoo package as.yearmon(excel_numeric_to_date(date)) [1] "Aug 2016" "Sep 2016" "Jun 2017" "Jul 2017" "Aug 2017" . However, the conversion for the first to elements of the date vector are incorrect. The actual result are: as.yearmon(excel_numeric_to_date(date)) [1] "Aug 2017" "Sep 2017" "Jun

Convert Excel numeric to date

最后都变了- 提交于 2019-12-05 20:24:17
I have a vector of numeric excel dates i.e. date <- c(42963,42994,42903,42933,42964) The output am I expecting when using excel_to_numeric_date function from janitor package and as.yearmon function from zoo package as.yearmon(excel_numeric_to_date(date)) [1] "Aug 2016" "Sep 2016" "Jun 2017" "Jul 2017" "Aug 2017" . However, the conversion for the first to elements of the date vector are incorrect. The actual result are: as.yearmon(excel_numeric_to_date(date)) [1] "Aug 2017" "Sep 2017" "Jun 2017" "Jul 2017" "Aug 2017" I have tried using different option( modern and mac pre-2011 ) for the date