Append an object to a list in R in amortized constant time, O(1)?
If it’s a list of string, just use the c() function : R> LL <- list(a=”tom”, b=”dick”) R> c(LL, c=”harry”) $a [1] “tom” $b [1] “dick” $c [1] “harry” R> class(LL) [1] “list” R> That works on vectors too, so do I get the bonus points? Edit (2015-Feb-01): This post is coming up on its … Read more