n: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Bert Jacobs
Verzonden: woensdag 14 mei 2008 15:43
Aan: 'Henrique Dallazuanna'
CC: r-help@r-project.org
Onderwerp: Re: [R] Dividing Two Dataframes
Hi Henrique,
I think I understand your formula, but your final result is a 12x160
d
SDF3 <- SDF1/SDF2[ rep(1:12,12), ]
-Original Message-
From: "Bert Jacobs" <[EMAIL PROTECTED]>
To: "'Henrique Dallazuanna'" <[EMAIL PROTECTED]>
Cc: "r-help@r-project.org"
Sent: 5/14/08 7:41 AM
Subject: Re: [R] Dividing Two Datafra
rows)
Is it easy to adapt your formula to get this result?
Thx,
Bert
_
From: Henrique Dallazuanna [mailto:[EMAIL PROTECTED]
Sent: 14 May 2008 13:34
To: Bert Jacobs
Cc: r-help@r-project.org
Subject: Re: [R] Dividing Two Dataframes
Try this:
DFS <- lapply(split(seq(1,
Try this:
DFS <- lapply(split(seq(1, 144, by = 1), rep(1:12, each = 12)),
function(x)SDF1[x,]/SDF2)
On Wed, May 14, 2008 at 5:02 AM, Bert Jacobs <[EMAIL PROTECTED]> wrote:
> Hi,
>
>
>
> I have two dataframes one with 144 rows and 160 columns (SDF1) and one
> with
> 12 rows and 160 columns (SDF2)
Hi,
I have two dataframes one with 144 rows and 160 columns (SDF1) and one with
12 rows and 160 columns (SDF2).
Now I'm trying to divide rows 1:12 with SDF2, rows 13:24 with SDF2, rows
25:36 with SDF 2, .
In S-Plus the following code works fine:
DFS = SDF1[1:144,1:60] / as.vector(SDF2[1:1
5 matches
Mail list logo