Thanks, Gabor. Works great!
On Thu, Jun 25, 2009 at 10:38 AM, Gabor Grothendieck <
ggrothendi...@gmail.com> wrote:
> Try this (shown for stated problem but generalizes by just adding
> additional arguments):
>
> mapply("[", list(x), ltrs, mnths)
>
>
> On Thu, Jun 25, 2009 at 10:24 AM, Rama Ramak
Thanks, David, that works too!
On Thu, Jun 25, 2009 at 10:30 AM, David Winsemius wrote:
>
> On Jun 25, 2009, at 10:24 AM, Rama Ramakrishnan wrote:
>
> Follow-on question: is there a way to do this for higher-dimensional (i.e.
>> more than 2 dimensions) arrays?
>>
>
> The apply method I just pos
Try this (shown for stated problem but generalizes by just adding
additional arguments):
mapply("[", list(x), ltrs, mnths)
On Thu, Jun 25, 2009 at 10:24 AM, Rama Ramakrishnan wrote:
> Follow-on question: is there a way to do this for higher-dimensional (i.e.
> more than 2 dimensions) arrays?
>
>
On Jun 25, 2009, at 10:24 AM, Rama Ramakrishnan wrote:
Follow-on question: is there a way to do this for higher-dimensional
(i.e.
more than 2 dimensions) arrays?
The apply method I just posted generalizes to higher dimensional arrays.
--
DW
On Thu, Jun 25, 2009 at 10:17 AM, Rama Ramakr
On Jun 25, 2009, at 10:02 AM, Rama Ramakrishnan wrote:
Dear R-Users,
I need to lookup values from a 2-d table using the row names and
column
names as indices. I was wondering if there's a way to do this
without an
explicit loop.
Example:
#x is the 2-d table that holds the values
x <- mat
Follow-on question: is there a way to do this for higher-dimensional (i.e.
more than 2 dimensions) arrays?
On Thu, Jun 25, 2009 at 10:17 AM, Rama Ramakrishnan wrote:
> That works!! Very nice way to do it! Thank you, Henrique!
> Rama Ramakrishnan
>
>
> On Thu, Jun 25, 2009 at 10:11 AM, Henrique D
Try this:
y$values <- diag(x[y$ltrs, y$mnths])
On Thu, Jun 25, 2009 at 11:02 AM, Rama Ramakrishnan wrote:
> Dear R-Users,
> I need to lookup values from a 2-d table using the row names and column
> names as indices. I was wondering if there's a way to do this without an
> explicit loop.
>
> Exam
That works!! Very nice way to do it! Thank you, Henrique!
Rama Ramakrishnan
On Thu, Jun 25, 2009 at 10:11 AM, Henrique Dallazuanna wrote:
> Try this:
>
> y$values <- diag(x[y$ltrs, y$mnths])
>
> On Thu, Jun 25, 2009 at 11:02 AM, Rama Ramakrishnan wrote:
>
>> Dear R-Users,
>> I need to lookup valu
Dear R-Users,
I need to lookup values from a 2-d table using the row names and column
names as indices. I was wondering if there's a way to do this without an
explicit loop.
Example:
#x is the 2-d table that holds the values
x <- matrix(rnorm(26*12),nrow=26)
rownames(x) <- letters
colnames(x) <
9 matches
Mail list logo