R/constructRunMatrix.R

Defines functions constructRunMatrix

Documented in constructRunMatrix

#'@title Construct Run Matrix given rows
#'
#'@description Returns number of levels prior to each parameter
#'
#'@param Levelvector Returns a vector consisting of the number
#'@keywords internal
#'@return Returns a vector consisting of the number
#'of levels preceeding each parameter (including the intercept)
constructRunMatrix = function(rowIndices, candidateList, augment=NULL) {
  trials = length(rowIndices)
  run_matrix = as.data.frame(candidateList[1:trials, ])
  colnames(run_matrix) = colnames(candidateList)
  for (i in 1:trials) {
    run_matrix[i, ] = candidateList[rowIndices[i], ]
  }
  if (!is.null(augment)) {
    run_matrix[1:nrow(augment), ] = augment
  }
  return(run_matrix)
}

Try the skpr package in your browser

Any scripts or data that you put into this service are public.

skpr documentation built on July 9, 2023, 7:23 p.m.