Closed ekothe closed 3 years ago
I think you've already fixed this one @ekothe!
At present if a participant provides a response that has capitalization and you want to add it to a custom dictionary - the dictionary entry you add will only work if it is entered in lower case. This is counter intuitive since the intuitive workflow is simply to copy the participant response verbatim when creating the new dictionary entry.
library(gendercoder)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
custom_dictionary <- list(
`I am male` = "male")
tibble(gender = c("I am male")) %>%
mutate(broad_gender = recode_gender(gender, dictionary = c(broad, custom_dictionary), fill = FALSE)
)
#> # A tibble: 1 x 2
#> gender broad_gender
#> <chr> <chr>
#> 1 I am male <NA>
custom_dictionary_2 <- list(
`i am male` = "male")
tibble(gender = c("I am male")) %>%
mutate(broad_gender = recode_gender(gender, dictionary = c(broad, custom_dictionary_2), fill = TRUE)
)
#> # A tibble: 1 x 2
#> gender broad_gender
#> <chr> <chr>
#> 1 I am male male
Created on 2021-03-16 by the reprex package (v1.0.0)
Issue reported by Nils Reimer via email