I have a list of observations in one column that I'd like to rename. The dataframe
is shown below. The column GEO has 40 distinct names that I'd like to rename. I've created another list with 40 alternative names that I'd like to use. Though I have thousands of observations, I only have 40 distinct names in there.
**Code to Reproduce**
library(cansim)
library(dplyr)
HPI_LIST <- c("v111955442", "v111955445", "v111955448", "v111955451", "v111955454", "v111955457", "v111955460", "v111955463", "v111955466", "v111955469", "v111955472", "v111955475", "v111955478", "v111955481", "v111955484", "v111955487", "v111955490", "v111955493", "v111955496", "v111955499", "v111955502", "v111955505", "v111955508", "v111955511", "v111955514", "v111955517", "v111955520", "v111955523", "v111955526", "v111955529", "v111955532", "v111955535", "v111955538", "v111955541", "v111955544", "v111955547", "v111955550", "v111955553", "v111955556", "v111955559")
NewHPIData <- get_cansim("18-10-0205-01")
NewHPI <- NewHPIData %>% filter(VECTOR %in% HPI_LIST, REF_DATE > 2018) %>%
arrange((COORDINATE)) %>%
select(REF_DATE, GEO, VALUE) %>% mutate(VALUE = VALUE / 100) %>%
arrange(GEO)
I'd like to update names in GEO for example I'd like to rename Alberta with "New Housing Price Index - AB (x 100)"