On Wed, Oct 10, 2012 at 7:09 PM, ramoss wrote:
> In SAS I use the following code:
>
> proc sort data=upper;
> by tdate stock_symbol expire strike;
> run;
> data upper1;
> set upper;
> by tdate stock_symbol expire strike;
> if first.expire then output;
> rename strike=astrike;
> run;
>
>
Hi,
here is one way using ddply (from the plyr package):
dat <- read.table(text="tdate stock_symbolexpiration strike
9/11/2012 C 9/16/201211
9/11/2012 C 9/16/201212
9/11/2012 C 9/16/201
day, October 10, 2012 5:42 PM
Subject: Re: [R] How to replicate SAS by group processing in R
On Oct 10, 2012, at 11:09 AM, ramoss wrote:
> Hello,
>
> I am trying to re-code all my programs from SAS into R.
>
> In SAS I use the following code:
>
> proc sort data=upper;
> b
On Oct 10, 2012, at 11:09 AM, ramoss wrote:
> Hello,
>
> I am trying to re-code all my programs from SAS into R.
>
> In SAS I use the following code:
>
> proc sort data=upper;
> by tdate stock_symbol expire strike;
> run;
> data upper1;
> set upper;
> by tdate stock_symbol expire strike;
Hello,
I am trying to re-code all my programs from SAS into R.
In SAS I use the following code:
proc sort data=upper;
by tdate stock_symbol expire strike;
run;
data upper1;
set upper;
by tdate stock_symbol expire strike;
if first.expire then output;
rename strike=astrike;
run;
on the
5 matches
Mail list logo