You need to reassign the value of append back to h -- in more technical terms, this is a pass-by-value rather than pass-by-reference behavior:
h <- append(h, 9) This is not likely to be efficient in production code, however. Michael On Tue, Feb 28, 2012 at 7:15 AM, sagarnikam123 <sagarnikam...@gmail.com> wrote: >> h<-array() >> h > [1] NA >> append(h,9) > [1] NA 9 > > but what it append......... >> h > [1] NA > > > -- > View this message in context: > http://r.789695.n4.nabble.com/how-to-append-element-at-last-position-in-array-dynamically-tp4427893p4427893.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. ______________________________________________ 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.