Hi again! Just in case someone ends up googling this for the same thing I
did, here is a modification to get around a little problem:

 dat1<-data.frame(keys=paste("key",5:1,sep=""),value=1:5)
splitlist <- split(dat1,dat1$keys)
list3<-sapply(splitlist,`[`,2) 
 names(list3)<-names(splitlist) 
list3$key2 
[1] 4

Because the list after split is stored in alphabetical order by name, it
reorders things, so you need to use that order when you name it.

Thanks again,
Anne




--
View this message in context: 
http://r.789695.n4.nabble.com/reading-in-a-very-simple-list-from-a-file-tp4645741p4645985.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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