I would like to ask you if there is a similar function like "match" in excel in R.
For example if I have a dataset with people's educational degrees:
chr [1:4] "Bachelor" "NA" "Master" "Superieur"
Main education program English translation Code
Brevet d'enseignement supérieur (BES) certificate of higher education 5
bachelier de transition Bachelor 6
Bachelor Bachelor 6
Master Master 7
One way, is using
Making a vector of strings with
paste0 and getting an index wherever it matches the first column (
Main_education_group). Using that index to fetch the respective
Code from the data frame.
ISCED$Code[grep(paste0(edu, collapse = "|"), ISCED$Main_education_program)] # 6 7