Skip to content

Commit

Permalink
same as prev. commit but coding is more elegant
Browse files Browse the repository at this point in the history
  • Loading branch information
tappek committed Dec 27, 2024
1 parent fe8baa0 commit ddbe1c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/est_gmm.R
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,9 @@ extract.data <- function(data, as.matrix = TRUE){
X <- cbind(data[[1L]], X)
colnames(X)[1L] <- deparse(trms[[2L]])
}
data <- if(!as.matrix) collapse::rsplit(as.data.frame(X), index[[1L]], simplify = FALSE)
else collapse::rsplit(X, index[[1L]], simplify = FALSE)

if(!as.matrix) X <- as.data.frame(X)
data <- collapse::rsplit(X, index[[1L]], simplify = FALSE)
time <- collapse::gsplit(index[[2L]], index[[1L]])
data <- mapply(
function(x, y){
Expand Down

0 comments on commit ddbe1c8

Please sign in to comment.