clean_my_data: Clean Data Types

View source: R/01_data_cleaning.R

clean_my_dataR Documentation

Clean Data Types

Description

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.

Usage

clean_my_data()

Value

A cleaned tibble.

Note

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.

Examples

## Not run: 
my_cleaned_data <- clean_my_data()

## End(Not run)

mrelnoob/jk.dusz.tarping documentation built on July 31, 2023, 9:19 a.m.