R may surprise you here, but it is self-consistent. What would you expect from the following? > x <- c(one=1,two=2,3,four=4) > x one two four 1 2 3 4 > x[c("two", "five")] <- c(twentytwo=22, fiftyfive=55) > x one two four five 1 22 3 4 55 'x[c(2,5)] <- ...' must act the same.
Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of JulioSergio > Sent: Thursday, November 10, 2011 11:51 AM > To: r-h...@stat.math.ethz.ch > Subject: Re: [R] Named components in a list > > Sarah Goslee <sarah.goslee <at> gmail.com> writes: > > > > > Hi, > > > > > You probably want: > > L["NewName"] <- "something" > > or one of the many potential variants. > > > > Thanks, Sara, > That works! > However, following the idea that the syntactic notation L[i] means > a sublist of L, again the syntactic notation > > L[i] <- list(Name=Value) > > should mean that the sublist is now assigned the list with the a unique named > element. So I insist this is either a bug or an inconsistency of the language. > > Thanks again, > > Sergio. > > ______________________________________________ > 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. ______________________________________________ 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.