I have a list list_A, that I want to iterate through in a forloop. However, I want to iterate through only the elements that are number. Example below:
#generate exmaple:
list_A <- list("A","B","C","8","1","5","3","U","2","C","6")
names(list_A) <- c("A","B","C","8","1","5","3","U","2","C","6")
# my attempt
for (i in names(list_A)) {
if (i == ??) {
print("is a number")
}
}