Hello,
The following might be a better solution.
I include a minimal data set as an example.
Date <- c(rep(as.Date("2018-03-29"), 4),
rep(as.Date("2018-03-30"), 4),
rep(as.Date("2018-04-01"), 4))
ari18.test3 <- data.frame(Date)
ari18.test3$GameNum <- 1
#---
d <- c(0, diff
Hello,
There was no attachment, R-Help allows only a limited number of file
types, see the posting guide and try reposting.
As for the question, try ifelse, the vectorized fom of if/else.
ifelse(ari18.test3$Date > lag(ari18.test3$Date), ari18.tesm3$GameNum +
1, ari18.test3$gameNum)
(Not t
Attached is every at bat for the Arizona Diamondback’s first three games of
2018 – BBdata1.rda. I added the Date and DHCode variables by parsing the first
variable labeled GameID.
BBdata2 is a reduced dataset with five variables as shown in the str() command.
data.frame':234 obs. of 5 var
3 matches
Mail list logo