---Original Message-
> > From: Rui Barradas [mailto:ruipbarra...@sapo.pt]
> > Sent: Sunday, August 19, 2012 3:54 PM
> > To: William Dunlap; Francesco
> > Cc: r-help
> > Subject: Re: [R] merging and obtaining the nearest value
> >
> > Hello,
> >
>
TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: Rui Barradas [mailto:ruipbarra...@sapo.pt]
> Sent: Sunday, August 19, 2012 3:54 PM
> To: William Dunlap; Francesco
> Cc: r-help
> Subject: Re: [R] merging and obtaining the nearest value
>
> Hello,
>
>
}
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of William Dunlap
Sent: Sunday, August 19, 2012 1:49 PM
To: Francesco; r-help@r-project.org
Subject: Re: [R] merging and o
t.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of William Dunlap
> Sent: Sunday, August 19, 2012 1:49 PM
> To: Francesco; r-help@r-project.org
> Subject: Re: [R] merging and obtaining the nearest value
>
> The following, f2(A,B), should do well with lots of rows in A
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of William Dunlap
> Sent: Sunday, August 19, 2012 9:43 AM
> To: Francesco; r-help@r-project.org
> Subject:
.@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of Rui Barradas
Sent: Sunday, August 19, 2012 3:52 AM
To: Francesco
Cc: r-help
Subject: Re: [R] merging and obtaining the nearest value
Hello,
Try the following.
A <- read.table(text="
TYPE DATE
A2
A
p-boun...@r-project.org] On
> Behalf
> Of Francesco
> Sent: Sunday, August 19, 2012 4:01 AM
> To: r-help@r-project.org
> Subject: Re: [R] merging and obtaining the nearest value
>
> Dear Riu, Many thanks for your suggestion
>
> However these are just simplified exa
Thank you very much Rui
On 19 August 2012 13:49, Rui Barradas wrote:
> Hello,
>
> Yes you can, if you have memory problems, say so and we'll see it then.
> In the mean time, there's something you should change, to allow for several
> minima but to only return one per combination of TYPE and DATE
Hello,
Yes you can, if you have memory problems, say so and we'll see it then.
In the mean time, there's something you should change, to allow for
several minima but to only return one per combination of TYPE and DATE.
Replace this
x[which(min(a) == a), ]
by this
x[which.min(a), ]
Rui Bar
Dear Riu, Many thanks for your suggestion
However these are just simplified examples... in reality the dataset A
contains millions of observations and B several thousands of rows...
Could I still use a modified form of your suggestion?
Thanks
On 19 August 2012 12:51, Rui Barradas wrote:
> Hello
Hello,
Try the following.
A <- read.table(text="
TYPE DATE
A2
A5
A20
B10
B2
", header = TRUE)
B <- read.table(text="
TYPE Special_Date
A 2
A 6
A 20
A 22
B 5
B
Dear R-help
Î would like to know if there is a short solution in R for this
merging problem...
Let say I have a dataset A as:
TYPE DATE
A2
A5
A20
B10
B2
(there can be duplicates for the same type and date)
and I have another dataset
12 matches
Mail list logo