Patrick Meyer <patrick.meyer <at> internet.lu> writes: : : Thank you Gabor. : : But I have a problem with the beginning of my algorithm, where the list : you call L is empty... then the code breaks down... It says: : : "Error in any(...,na.rm = na.rm) : incorrect argument type" : : How can I handle this? :
Good point. We can rescue it by doing the simplification ourself using unlist(lapply(...)) instead of sapply(...): L <- list() newentry <- c("a3", "a1", "a4") if (!any(unlist(lapply(L, setequal, newentry)))) L <- c(L, list(newentry)) ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html