Displaying 2 results from an estimated 2 matches for "jymint".
2008 Jul 22
2
How to....
Hi everyone,
I am not new to R, but its been over a year since I've used it, so I
don't remember how to do some things.
I have a data set (in excel currently, but will be converted to text),
that has date, country and price, with a price for every country for
every date. I need to find the mean and median of the interval between
price changes for each country and the mean and median
2008 Jul 26
1
Marking Interval Length
...frame(country=rep(c("au","br""cn","in","us"),each=100),
date=rep(as.Date("02/02/2008",
format="%d/%m/%Y"),500)+sample(-40:40,500,TRUE),
price=rnorm(500,100,20))
# get the intervals by country - have to create a new data frame
jymint.df<-data.frame(country=rep(levels(jym.df$country),each=99),
intervals=unlist(tapply(jym.df$date,jym.df$country,diff)))
library(prettyR)
# break down the intervals by country
brkdn(intervals~country,jymint.df,num.desc=c("mean","median"))
But, obviously the first step generat...