Bugzilla from gordon.holtslan...@usask.ca wrote:
>
> I'm new at R ...
> I've not done for loops in R - so this is very new to me.
>
> One of our students has a data frame that contains two columns data
>
> 1. unixtime time of an event (in unix time - #of seconds)
> 2. duration of event in sec
Try this:
x <- data.frame(u=c(1:5), seconds=sample(5))
transform(x[rep(1:nrow(x),x$seconds),], seconds =
unlist(lapply(split(x$seconds, x$u), seq)))
On Tue, Jun 9, 2009 at 6:11 PM, Gordon J Holtslander <
gordon.holtslan...@usask.ca> wrote:
> I'm new at R ...
> I've not done for loops in R - so
I'm new at R ...
I've not done for loops in R - so this is very new to me.
One of our students has a data frame that contains two columns data
1. unixtime time of an event (in unix time - #of seconds)
2. duration of event in seconds.
We need to create new data - the unixtime (seconds) that these
3 matches
Mail list logo