Skip to content

write_attributes does not recognize class time #38

@srearl

Description

@srearl

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions