Created
February 20, 2020 20:58
-
-
Save hepplerj/8769597368e8b15c1f0791861cd3c55b to your computer and use it in GitHub Desktop.
Messy data in R, for teaching the tidyverse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(charlatan) | |
library(salty) | |
library(magrittr) | |
library(readr) | |
messydata <- ch_generate('name','job','phone_number', n = 200) | |
messydata <- messydata %>% | |
mutate(job = salt_capitalization(job)) %>% | |
mutate(phone_number = salt_na(phone_number)) %>% | |
mutate(name = salt_na(name)) %>% | |
mutate(job = salt_insert(job, shaker$whitespace, p = 0.2)) | |
readr::write_csv(messydata, "messydata.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment