PSA: This is in regards to a homework assignment. I'm posting here because I've tried searching StackOverflor and other resources from Google to no avail :( If you don't want to help, I understand! Just don't be mean about it please.
Hey everyone! I have a vector in a dataframe storing names
c("A", "B", "C", "D", "E")
and a function accepting a parameter
function(alphabet)
How do I (in one line) send each name as a parameter to a function? I want it to send each name once to the function. I've tried looking online and have realized I may have to use replicate, but I cannot figure out how to send each element as a parameter. Thanks!
Edit- as of now, I acknowledge I'm supposed to use replicate, but this is what I have-
lapply(unique(df$vector), function(), USE.NAMES = TRUE)