Hi Jacob,
The below code should help solve the error. The samples that you shared i.e. 2364 and 4567 are not valid ISCO-08 codes and will give you an error Error in FUN(X[[i]], ...) : Invalid ISCO08-Code
#1. Create a list of ISCO-08 Codes that you wish to work with
my_sample_list<-list("1000","1221","9629")
#2. Use the lapply function to assign scores to each code from the sample list
lapply(my_sample_list, isco08toisei08_2)
Below is how the output of the above code looks like:
[[1]]
[1] 62
[[2]]
[1] 66
[[3]]
[1] 20
You can also use the below code to make the output a bit more intuitive:
library(dplyr)
#1. Create a list of ISCO-08 Codes that you wish to work with
my_sample_list<-list("1000","1221","9629")
#2. Use the lapply function to assign the scores to each code from the sample list and matrix function to give a tabular view
lapply(my_sample_list, isco08toisei08_2) %>%
matrix(nrow=1,ncol=length(my_sample_list),dimnames = list(c("ISEI-08 Score"),c(my_sample_list)))
Below is how the output of the above code looks like:
1000 1221 9629
ISEI-08 Score 62 66 20
Warm Regards,
Pritish