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 this command line: (1) I wanted to use colnames(Model)[2] as a tag for the list: > colnames(Model)[2] [1] "gender" but it is not working as I intended. How to make colnames(Model)[2] a legitimate tag? (2) Model$gender is a column in the data.frame. However Model$ (colnames(Model)[2]) seems not recognizable in the command line. How to correct this? (3) How to add more tagged items to an existing list? cbind or rbind? Thanks in advance, Gang
Trouble in creating a list
2 messages · Gang Chen, Henrique Dallazuanna
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071107/075f1ffb/attachment.pl