Category "data-manipulation"

Multiply without eliminate information

I have a dataframe and I would like to maintain information. My data frame is like: a <- c("a","b", "c", "d") b <- c("e","f", "g", "h") c <- c(1, 2, 1,

How can I access and process nested objects, arrays or JSON?

I have a nested data structure containing objects and arrays. How can I extract the information, i.e. access a specific or multiple values (or keys)? For examp

Sum over previous periods for each period for each subject - R

A MWE is as follows: library(dplyr) Period <- c(1, 1, 1, 2, 2, 2, 3, 3, 3) Subject <- c(1, 2, 3, 1, 2, 3, 1, 2, 3) set.seed(1) Values <- round(rnor