An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090209/326157df/attachment-0001.pl>
sapply
3 messages · Sundar Dorai-Raj, glenn
I'm not sure what you really want, so perhaps a simple example would help (i.e. what a sample of the input looks like and what the output you need looks like). My guess would be sapply(df, diff) but again, I'm not sure. --sundar
On Sun, Feb 8, 2009 at 4:24 PM, glenn <g1enn.roberts at btinternet.com> wrote:
Newbie question sorry (have tried the help pages I promise)
I have a dataframe (date,stockprice) say and looking how I might get the
return of: dataframe (difference in days, change in stock price) using
sapply - I require a very simple function and don't really want to go down
the zoo and quant mod route
Regards
glenn
[[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.
Bullseye ! thanks a lot Sundar -----Original Message----- From: Sundar Dorai-Raj [mailto:sdorairaj at gmail.com] Sent: 09 February 2009 00:31 To: glenn Cc: r-help at r-project.org Subject: Re: [R] sapply I'm not sure what you really want, so perhaps a simple example would help (i.e. what a sample of the input looks like and what the output you need looks like). My guess would be sapply(df, diff) but again, I'm not sure. --sundar
On Sun, Feb 8, 2009 at 4:24 PM, glenn <g1enn.roberts at btinternet.com> wrote:
Newbie question sorry (have tried the help pages I promise)
I have a dataframe (date,stockprice) say and looking how I might get the
return of: dataframe (difference in days, change in stock price) using
sapply - I require a very simple function and don't really want to go down
the zoo and quant mod route
Regards
glenn
[[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.