Skip to main content

R

·71 words·1 min·
Table of Contents

Data clean

Change values

# Perform the required changes based on the symbol column
Immigrant <- Immigrant_ori %>%
  mutate(
    ipoYear = case_when(
      symbol == "IRBS" ~ 2000,
      symbol == "IYXI" ~ 2003,
      TRUE ~ ipoYear
    ),
    country = case_when(
      symbol == "GOTO.TA" ~ "AU",
      TRUE ~ country
    )
  ) %>%
  filter(symbol != "VTRS")

GOTO <- Immigrant %>% filter(symbol == "GOTO.TA") # check the modified rows

rm(GOTO) # remove it after checking