Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_attributes does not recognize class time #38

Open
srearl opened this issue Nov 22, 2021 · 0 comments
Open

write_attributes does not recognize class time #38

srearl opened this issue Nov 22, 2021 · 0 comments
Assignees

Comments

@srearl
Copy link
Contributor

srearl commented Nov 22, 2021

MainYardData081819.csv

main_yard_data <- readr::read_csv(
  file = "data_files_for_publications/MainYardData081819.csv",
  show_col_types = FALSE
  ) |>
dplyr::mutate(
  across(where(is.character), as.factor),
  year = as.character(year),
  time = as.character(time),
  front_yard_typology_other = as.character(front_yard_typology_other),
  other_yard_features = as.character(other_yard_features),
  lawn_notes = as.character(lawn_notes),
  overall_lawn_quality = as.factor(overall_lawn_quality),
  describe_other_area_weeds = as.character(describe_other_area_weeds),
  tree_pruning_other = as.character(tree_pruning_other),
  shrub_pruning_other = as.character(shrub_pruning_other),
  interactions_with_resident = as.character(interactions_with_resident),
  misc_notes = as.character(misc_notes)
)

try({
  capeml::write_attributes(main_yard_data)
  capeml::write_factors(main_yard_data)
})

Error in .f(.x[[i]], .y[[i]], ...) :
dataframe has a variable for which the class could not be determined

Turned out that time, which R recognized as a type <time> was the problem.

@srearl srearl self-assigned this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant