diff --git a/DESCRIPTION b/DESCRIPTION index 54505b0..ced4eb0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: SGPmatrices Type: Package Title: Baseline Coefficient Matrices for SGP Analyses -Version: 0.1-2.0 -Date: 2025-4-21 +Version: 0.1-3.0 +Date: 2025-12-23 Authors@R: c(person(given=c("Damian", "W."), family="Betebenner", email="dbetebenner@nciea.org", role=c("aut", "cre")), person(given=c("Adam", "R."), family="Van Iwaarden", email="avaniwaarden@nciea.org", role="aut")) Maintainer: Damian W. Betebenner diff --git a/R/addBaselineMatrices.R b/R/addBaselineMatrices.R index 6371ee5..4ff55c0 100644 --- a/R/addBaselineMatrices.R +++ b/R/addBaselineMatrices.R @@ -1,26 +1,34 @@ `addBaselineMatrices` <- function(state, year, - add.matrices.to.which.state=NULL) { + add.matrices.to.which.state=NULL, + SGPt = FALSE) { SGPstateData <- SGP::SGPstateData ### Needed due to assignment of values to SGPstateData ### Utility function - getMatrixLabel <- function(state, year, add.matrices.to.which.state) { - if (!paste(state, "Baseline_Matrices", sep="_") %in% names(SGPmatrices::SGPmatrices)) { + getMatrixLabel <- function(state, year, add.matrices.to.which.state, SGPt) { + ifelse(SGPt, state.label <- paste(state, "SGPt_Baseline_Matrices", sep="_"), state.label <- paste(state, "Baseline_Matrices", sep="_")) + if (!state.label %in% names(SGPmatrices::SGPmatrices)) { stop(paste("\tNOTE: Baseline matrices for state:", state, "not in SGPmatrices. Contact package maintainer to have baseline matrices added to package.")) } - tmp.years <- names(SGPmatrices::SGPmatrices[[paste(state, "Baseline_Matrices", sep="_")]]) + tmp.years <- names(SGPmatrices::SGPmatrices[[state.label]]) if (year < sort(tmp.years)[1]) stop("NOTE: Supplied year precedes years associated with baseline matrices in package. Contact package developer if you think this is in error.") if (!year %in% tmp.years) year <- tmp.years[which(year==sort(c(tmp.years, year)))-1L] - matrix.label <- paste0("SGPmatrices::SGPmatrices[['", paste(state, "Baseline_Matrices", sep="_"), "']][['", year, "']]") - message(paste0("\tNOTE: Adding ", SGP::getStateAbbreviation(state, type="Long"), " (", state, ") ", year, " baseline matrices to SGPstateData for state ", + if (!SGPt) { + matrix.label <- paste0("SGPmatrices::SGPmatrices[['", state.label, "']][['", year, "']]") + message(paste0("\tNOTE: Adding ", SGP::getStateAbbreviation(state, type="Long"), " (", state, ") ", year, " baseline matrices to SGPstateData for state ", add.matrices.to.which.state)) + } else { + matrix.label <- paste0("SGPmatrices::SGPmatrices[['", state.label, "']][['", year, "']]") + message(paste0("\tNOTE: Adding ", SGP::getStateAbbreviation(state, type="Long"), " (", state, ") ", year, " SGPt baseline matrices to SGPstateData for state ", + add.matrices.to.which.state)) + } return(matrix.label) } if (is.null(add.matrices.to.which.state)) add.matrices.to.which.state <- state - SGPstateData[[add.matrices.to.which.state]][["Baseline_splineMatrix"]][["Coefficient_Matrices"]] <- eval(parse(text=getMatrixLabel(state, year, add.matrices.to.which.state))) + SGPstateData[[add.matrices.to.which.state]][["Baseline_splineMatrix"]][["Coefficient_Matrices"]] <- eval(parse(text=getMatrixLabel(state, year, add.matrices.to.which.state, SGPt))) return(SGPstateData) } ### END addBaselineMatrices diff --git a/R/zzz.R b/R/zzz.R index dd12d4c..50ba03b 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -32,7 +32,7 @@ function(libname, pkgname) { # Define a friendly startup message message_text <- paste0( - magenta(bold("\uD83C\uDF89 SGPmatrices v", installed.version, sep="")), " - ", toOrdinal::toOrdinalDate("2025-4-21"), "\n", + magenta(bold("\uD83C\uDF89 SGPmatrices v", installed.version, sep="")), " - ", toOrdinal::toOrdinalDate("2025-12-23"), "\n", strrep("\u2501", 40), "\n", bold("\U1F4E6 CRAN: "), cran.version, "\n", bold("\U1F527 Dev: "), dev.version, "\n", diff --git a/README.md b/README.md index cb3308c..4599898 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ The baseline coefficient matrices embedded in **SGPmatrices** are updated period * AZ_Baseline_Matrices: Contains 2021 baseline matrices for Arizona AzM2. * CO_Baseline_Matrices: Contains 2021 baseline matrices for Colorado CMAS. * HI_Baseline_Matrices: Contains 2021 baseline matrices for Hawaii SBA. +* HI_SGPt_Baseline_Matrices: Contains 2021 SGPt time-dependent baseline matrices for Hawaii SBA. * IN_Baseline_Matrices: Contains 2021 baseline matrices for Indiana ILEARN/ISTEP+. * MA_Baseline_Matrices: Contains 2021 baseline matrices for Massachusetts MCAS 2.0/PARCC. * MI_Baseline_Matrices: Contains 2021 baseline matrices for Michigan MSTEP/PSAT/SAT. diff --git a/data/SGPmatrices.rda b/data/SGPmatrices.rda index bc485aa..ff341ed 100644 Binary files a/data/SGPmatrices.rda and b/data/SGPmatrices.rda differ diff --git a/inst/CITATION b/inst/CITATION index 35830a1..7e82b2f 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -4,11 +4,11 @@ citEntry(entry = "Manual", title = "{SGPmatrices}: Baseline coefficient matrices for SGP analyses.", author = "Damian W. Betebenner and Adam R. Van Iwaarden", year = "2025", - note = "R package version 0.1-2.0", + note = "R package version 0.1-3.0", url = "https://github.com/CenterForAssessment/SGPmatrices/", textVersion = paste("Damian W. Betebenner and Adam R. Van Iwaarden (2025).", "SGPmatrices: Baseline coefficient matrices for SGP analyses.", - "(R package version 0.1-2.0", + "(R package version 0.1-3.0", "URL https://github.com/CenterForAssessment/SGPmatrices/") ) diff --git a/man/SGPmatrices-package.Rd b/man/SGPmatrices-package.Rd index c08a46d..cd89200 100644 --- a/man/SGPmatrices-package.Rd +++ b/man/SGPmatrices-package.Rd @@ -10,8 +10,8 @@ \tabular{ll}{ Package: \tab SGPmatrices\cr Type: \tab Package\cr -Version: \tab 0.1-2.0\cr -Date: \tab 2025-4-21\cr +Version: \tab 0.1-3.0\cr +Date: \tab 2025-12-23\cr License: \tab GPL-3\cr LazyLoad: \tab Yes\cr LazyData: \tab Yes\cr diff --git a/man/addBaselineMatrices.Rd b/man/addBaselineMatrices.Rd index adafc2d..b2d44fb 100644 --- a/man/addBaselineMatrices.Rd +++ b/man/addBaselineMatrices.Rd @@ -9,7 +9,8 @@ The function addBaselineMatrices adds baseline matrices contained in the SGPmatr addBaselineMatrices( state, year, - add.matrices.to.which.state=NULL) + add.matrices.to.which.state=NULL, + SGPt = FALSE) } \arguments{ @@ -19,6 +20,10 @@ addBaselineMatrices( } \item{add.matrices.to.which.state}{A character string for the state/assessment abbreviation where the baseline matrices will be placed in SGPstateData. If not argument is supplied the default is to use the state/assessment abbreviation supplied via the argument \code{state}. } + \item{SGPt}{A logical value indicating whether to add SGPt baseline matrices. If not argument is supplied the default is to use the value of \code{SGPt} embedded in the SGPstateData object. + If \code{SGPt} is \code{TRUE}, the function will add SGPt baseline matrices to the SGPstateData object. + If \code{SGPt} is \code{FALSE}, the function will add baseline matrices to the SGPstateData object. + } } \value{Returns SGPstateData with the matrices associated with argument \code{state} embedded in the position associated with the argument \code{add.matrices.to.state} (defaults to \code{state}).