Message-ID: <7B0C1031-DD87-411D-AFEA-3A923AB92856@micromata.de>
Date: 2012-07-13T08:35:16Z
From: Jessica Streicher
Subject: Substitute list value
In-Reply-To: <CAJji86uPNoYp37_Ay0jLkE2JHaKNLqO7n-=LNLojSBXqeEUx4g@mail.gmail.com>
two things:
- R always counts from 1, not from 0
- listmembers are accessed by using [[ ]] , not [ ]
try
t1[t==ll[[1]], "v"] <- 99
greetings Jessi
On 11.07.2012, at 15:47, Charles Stangor wrote:
> I can't seem to determine how to get the name of a list member to
> substitute:
>
> ll <- list("a1" = "a","a2" = "b")
>
> t1[t==ll[0], "v"] <- 99
>
> why doesn't this substitute to:
>
> t1[t=="a", "v"] <- 99
>
> Thank you!
>
>
>
>
> --
> Charles Stangor
> Professor
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.