Tag: previous row in R data.table
Value from next or previous row in R data frame using data.table
If you are working with large datasets and want to get value from the next or previous row in R, try to use the data.table. It is possible to do the same with base R or dplyr, but it might be too slow. Basically, this approach with the data.table to get value from the next…