Skip to content

Commit

Permalink
feat: check mclust method data for equal length and spaced trajectori…
Browse files Browse the repository at this point in the history
…es (#138)
  • Loading branch information
niekdt committed Sep 18, 2023
1 parent d8b748f commit 7354054
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/methodMclustLLPA.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ setMethod('prepareData', 'lcMethodMclustLLPA', function(method, data, verbose, .
assert_that(noNA(data[[valueColumn]]), msg = 'data contains missing values')

# Data
wideFrame = as.data.table(data) %>%
data.table::dcast(get(idVariable(method)) ~ get(timeVariable(method)), value.var = valueColumn)
e$data = as.matrix(wideFrame[, -'method']) %>%
set_rownames(wideFrame$method)
e$data = tsmatrix(
data,
response = responseVariable(method),
id = idVariable(method),
time = timeVariable(method),
fill = FALSE
)

return(e)
})
Expand Down

0 comments on commit 7354054

Please sign in to comment.