Thank you again all responders. Dan your solution was both easy & miraculous.
--
View this message in context:
http://r.789695.n4.nabble.com/Can-you-have-a-by-variable-in-Lag-function-as-in-SAS-tp4649647p4649773.html
Sent from the R help mailing list archive at Nabble.com.
Hi Ramoss,
There are a few solutions to this - probably the best solution involves proper
handling of time series/date objects.
But, for "an" answer try:
# Build a data frame ...
set.seed(123)
someTimes <- sapply(1:5, function(i) sort(round(runif(6, 0, 24
myDf <- data.frame(Day = rep(1:5, ea
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of ramoss
> Sent: Thursday, November 15, 2012 11:56 AM
> To: r-help@r-project.org
> Subject: [R] Can you have a by variable in Lag function as in SAS
>
> Hello,
>
> I want to use l
3 matches
Mail list logo