[R] how to make hash?& append element, if i want following condition

R. Michael Weylandt michael.weylandt at gmail.com
Wed Feb 22 15:17:09 CET 2012


The easiest way to get a hash structure is to use environments.

hash1 <- new.env()
hash1$A <- c(1.2, 3.4, 4.5) # etc.

If I remember right there is a package on CRAN that abstracts some of
this interface away (it's not the most intuitive) but this would
likely be the core of it.

Michael

On Wed, Feb 22, 2012 at 4:49 AM, sagarnikam123 <sagarnikam123 at gmail.com> wrote:
> i want hash like
> A  :  1.2, 3.4, 4.5
> B  :  9.7, 5.6, 4.8
> C  :  3.4 ,5.7, 4.6
>
> where A key contain all three value at right sight
>
> how to append single keys & values if i have predefined hash with known
> length
>
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-make-hash-append-element-if-i-want-following-condition-tp4409761p4409761.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list