python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Creating a column which values are TRUE, if other column moves from FALSE to TRUE, by group
I have data as follows:
library(stringi)
datfake <- as.data.frame(runif(100, 0, 3000))
names(datfake)[1] <- "Inc"
datfake$type <- sample(LETTERS, 100, replace = TRUE)
datfake$provi...
Tom
Votes: 0
Answers: 1
How to get time difference in days since last date (lag) in R using datatable?
person_id diag_date concept_id event diff_prev_event
1: 1 2012-01-15 4265600 comorb NA secs
2: 1 2012-01-15 201820 comorb 0 secs
3: 1 2012-03-15 42...
sutsabs
Votes: 0
Answers: 1
Creating a function with lag variables from same column in a list in R
I have a set of dataframes in a list and have to create an extra column for each dataframe (which I´ve done) and then create a formula for the first row, and a different one from the second row onward...
Eduardo Orellana Buigley
Votes: 0
Answers: 3
R create lag variable in unbalance time series dataframe
I want to create a lag variable in my dataframe.
I have a list of time c("20110127", "20110128", "20110129", "20110130", "20110131", "20110201&qu...
violetl
Votes: 0
Answers: 2