rubenarslan / codebook

Cook rmarkdown codebooks from metadata on R data frames
https://rubenarslan.github.io/codebook/
Other
141 stars 16 forks source link

Error building codebook #45

Closed BroVic closed 4 years ago

BroVic commented 4 years ago

Hello @rubenarslan

Hitherto the function codebook worked well for me, but now I'm getting an error. I suppose it must be linked to a package dependency, since I recently updated my project. The error message is as follows:

Error: No common type for `..1$by_variable$numeric.min` <labelled> and `..2$by_variable$numeric.min` <labelled>.

I'm not sure, but it looks like its having difficulty dealing with variables of type numeric.

Here's the traceback:

33. stop(cnd)
32. abort(message, .subclass = c(.subclass, "vctrs_error"), ...)
31. stop_vctrs(message, .subclass = c(.subclass, "vctrs_error_incompatible"), x = x, y = y, details = details, ...)
30. stop_incompatible(x, y, x_arg = x_arg, y_arg = y_arg, details = details, ..., message = message, .subclass = c(.subclass, "vctrs_error_incompatible_type"))
29. stop_incompatible_type(x, y, x_arg = x_arg, y_arg = y_arg)
28. vec_ptype2.default(x = x, y = y, x_arg = x_arg, y_arg = y_arg)
27. vec_type2_dispatch(x = x, y = y, x_arg = x_arg, y_arg = y_arg)
26. vec_rbind(!!!x, .ptype = ptype)
25. unchop(data, !!cols, keep_empty = keep_empty, ptype = ptype)
24. unnest.data.frame(out, .data$by_variable)
23. tidyr::unnest(out, .data$by_variable)
22. build_results(skimmed, variable_names, NULL)
21. skim_by_type.data.frame(.x[[1L]], .y[[1L]], ...)
20. .f(.x[[1L]], .y[[1L]], ...)
19. purrr::map2(.data$skimmers, .data$skim_variable, skim_by_type, data)
18. summarise_impl(.data, dots, environment(), caller_env())
17. summarise.tbl_df(grouped, skimmed = purrr::map2(.data$skimmers, .data$skim_variable, skim_by_type, data))
16. dplyr::summarize(grouped, skimmed = purrr::map2(.data$skimmers, .data$skim_variable, skim_by_type, data))
15. skim_codebook(x)
14. "skim_type" %in% names(object)
13. has_type_column(object)
12. stopifnot(has_type_column(object), has_variable_column(object), has_skimr_attributes(object), nrow(object) > 0)
11. assert_is_skim_df(data)
10. skimr::partition(skim_codebook(x))
9. exists("POSIXct", df)
8. coerce_skimmed_summary_to_character(skimr::partition(skim_codebook(x)))
7. dots_values(...)
6. flatten_bindable(dots_values(...))
5. dplyr::bind_rows(coerce_skimmed_summary_to_character(skimr::partition(skim_codebook(x))), .id = "data_type")
4. skim_to_wide_labelled(results)
3. codebook_table(results)
2. codebook_items(results, indent = indent)
1. codebook(codebook_data)

Thanks in advance!

rubenarslan commented 4 years ago

Maybe you've updated to the development version of dplyr? I still need to make codebook work with it. I'd glady accept a pull request if you feel up to the challenge; I have until May but am super swamped

rubenarslan commented 4 years ago

new github version fixes this