View source: R/01_data_cleaning.R
clean_my_data | R Documentation |
The function clean_my_data
automatically imports the raw_data of the knotweed's
tarping survey and cleans by transforming character variables into factors, ordinal variables into
ordered factors, and boolean/binary variables into factors.
clean_my_data()
A cleaned tibble.
The variables "plantation" and "age" are ordinal variables and I have thus coded them
as such (as an ordered factor). However, it might be preferable, from a statistical point of view,
to consider it as a numeric variable. The 2nd solution would be more parsimonious (less levels and
thus lighter models) but would assume that intervals between each level (between 0 and 1,
between 1 and 2, etc.) are equals when it's not a necessarily true assumption (for "plantation",
it's probably not). The 1st solution will cause models to add polynomial terms to my factor levels
(see marked pages in my web browsers).
I also coded "planned_duration" as an ordinal variable but it there's no problem here because I will
probably not use it in statistical analyses.
## Not run:
my_cleaned_data <- clean_my_data()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.