I want to generate a list (called "dataList" below) where each of its levels is named. These names are assigned to nameList, which contains all possible permutations of size two taking letters from a larger alphabet, e.g., "aa",...,"Fd",..,"Z1",... One of these permutations is the character string "NA". It seems that when I try to name one of the dataList levels "NA", using names(dataList)<- nameList, the names() function assigns the missing character to the level. Is there someway to preserve "NA" as the name of a level in dataList? Here is the R code I have been using to do this.

namePerms<- permutations(ncol(coinMat),2,colnames(coinMat),repeats=TRUE)
nameList <- paste(namePerms[,1],namePerms[,2],sep="")
dataList <- lapply(1:length(nameList), function(level) {})
names(dataList)<- nameList ## The "NA" in nameList is interpreted so that the name "NA" is missing for one level in dataList

I am running R 2.4.1 in the Windows XP environment.

Thanks for any help that can be offerred.

Cliff Behrens


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to