diff --git a/lectures/week_03/images/allison_horst_cases.png b/lectures/week_03/images/allison_horst_cases.png new file mode 100644 index 0000000..2374c61 Binary files /dev/null and b/lectures/week_03/images/allison_horst_cases.png differ diff --git a/lectures/week_03/lec_09_working_with_data.Rmd b/lectures/week_03/lec_09_working_with_data.Rmd index e39727e..bcdcf58 100644 --- a/lectures/week_03/lec_09_working_with_data.Rmd +++ b/lectures/week_03/lec_09_working_with_data.Rmd @@ -83,6 +83,21 @@ Choose good names | obs_01 | first_obs | 1st Obs. | +## An aside on cases in coding + +![](images/allison_horst_cases.png){ width=80% } + + +## The janitor package handles suboptimal column names + +* The [janitor](https://www.rdocumentation.org/packages/janitor/versions/2.2.1) package has an extremely useful function called `clean_names()` which will handle all of your gross header names for you + +* From the `clean_names()` documentation: + +
+ +
Resulting names are unique and consist only of the _ character, numbers, and letters. Capitalization preferences can be specified using the case parameter.
+ ## Organizing data in spreadsheets | Broman & Woo (2018) No empty cells -- use `NA` or some other placeholder diff --git a/lectures/week_03/lec_09_working_with_data.html b/lectures/week_03/lec_09_working_with_data.html index 9d76fea..0a89c2f 100644 --- a/lectures/week_03/lec_09_working_with_data.html +++ b/lectures/week_03/lec_09_working_with_data.html @@ -3289,6 +3289,25 @@

+

An aside on cases in coding

+ + + +

The janitor package handles suboptimal column names

+ + + +


+ +
+ +Resulting names are unique and consist only of the _ character, numbers, and letters. Capitalization preferences can be specified using the case parameter. + +
+

Organizing data in spreadsheets

Broman & Woo (2018)

No empty cells – use NA or some other placeholder