0.1 Announcements

0.2 Agenda

Making sense of strings: how to deal with data of class character.

We’ll be using the following data that ships with stringr, today’s R package that comes shipped with tidyverse:

str(stringr::fruit)
 chr [1:80] "apple" "apricot" "avocado" "banana" "bell pepper" "bilberry" "blackberry" ...
str(stringr::words)
 chr [1:980] "a" "able" "about" "absolute" "accept" "account" "achieve" "across" "act" "active" ...
str(stringr::sentences)
 chr [1:720] "The birch canoe slid on the smooth planks." ...

0.3 Worksheet

To get participation points for today, we’ll be filling out the cm102-exercise.Rmd file.

Add this to your participation repo.

LS0tCnRpdGxlOiAiU1RBVCA1NDdNIENsYXNzIE1lZXRpbmcgMDI6IEJlIHRoZSBib3NzIG9mIHlvdXIgY2hhcmFjdGVyIGRhdGEiCm91dHB1dDoKICAgIGh0bWxfbm90ZWJvb2s6CiAgICAgICAgdG9jOiB0cnVlCiAgICAgICAgdGhlbWU6IGNlcnVsZWFuCiAgICAgICAgbnVtYmVyX3NlY3Rpb25zOiB0cnVlCmVkaXRvcl9vcHRpb25zOiAKICBjaHVua19vdXRwdXRfdHlwZTogaW5saW5lCi0tLQoKIyMgQW5ub3VuY2VtZW50cwoKLSBGaWxsIG91dCBbY2xhc3Mgc3VydmV5XShodHRwczovL2dvby5nbC9mb3Jtcy9VUHZSQTZhOVdSb2Q4SlBiMikgaWYgeW91IGhhdmVuJ3QgYWxyZWFkeSBkb25lIHNvIGluIFNUQVQgNTQ1QS4gVGhpcyBhbGxvd3MgdXMgdG8gbGluayB5b3UgdG8geW91ciBnaXRodWIgdXNlcm5hbWUuIFRoZSBsaW5rIGlzIGFsc28gYXZhaWxhYmxlIG9uIHRoZSBjb3Vyc2UgaG9tZXBhZ2UsIHN0YXQ1NDUuY29tL0NsYXNzcm9vbS4KLSBQYXJ0aWNpcGF0aW9uOgogICAgLSBDYW4ndCBhdHRlbmQgbGVjdHVyZSBmb3Igc29tZSBsZWdpdGltYXRlIHJlYXNvbiAoYmVzaWRlcyBub3Qgd2FudGluZyB0byBjb21lKT8gTGV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