Skip to content

Instantly share code, notes, and snippets.

@smancuso
Last active June 8, 2018 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smancuso/a05c3bccbf43c15745bc1ab2226e8389 to your computer and use it in GitHub Desktop.
Save smancuso/a05c3bccbf43c15745bc1ab2226e8389 to your computer and use it in GitHub Desktop.
Example 10.2 RePROCESS Model 1 Data Import
# Import 'protest' data and convert 'protest' to 'labelled'
protest <- read.csv("protest.csv", header = TRUE) %>%
mutate(
protest = labelled(
protest,
c(
"No protest" = 0,
"Individual protest" = 1,
"Collective protest" = 2
)
)
)
# Check class of 'protest'
class(protest$protest)
## [1] "labelled"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment