Re: [R] Trouble in creating a list

2007-11-07 Thread Henrique Dallazuanna
Hi, i think that is more easy MyList <- list(levels(Model[,colnames(Model)[2]])) names(MyList) <- colnames(Model)[2] On 07/11/2007, Gang Chen <[EMAIL PROTECTED]> wrote: > > Hi, > > I really appreciate your help! As I'm still learning basics in R, please > pardon my simple questions. > > It seems

Re: [R] Trouble in creating a list

2007-11-07 Thread Henrique Dallazuanna
Try this: 1)eval(parse(text=paste("MyList<-list(", colnames(Model)[2], "=", Model[,colnames(Model)[2]], ")"))) 2)Model[,colnames(Model)[2]] 3)MyList[[3]] <- "Teste" MyList[[4]] <- "Teste1" -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 07/11/2007, Gang Chen

[R] Trouble in creating a list

2007-11-07 Thread Gang Chen
I want to create a list based on the information from a data.frame, Model. So I tried the following: MyList <- list(colnames(Model)[2] = levels(Model$(colnames(Model)[2]))) but it failed with an error: Error: unexpected '=' in "list(colnames(Model)[2] =" I have the following problems with th