Last active
June 8, 2018 09:41
-
-
Save smancuso/a05c3bccbf43c15745bc1ab2226e8389 to your computer and use it in GitHub Desktop.
Example 10.2 RePROCESS Model 1 Data Import
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
# 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