Skip to content

Commit

Permalink
Updating createSuperCohort function
Browse files Browse the repository at this point in the history
  • Loading branch information
dbetebenner committed Oct 10, 2024
1 parent 3bdc641 commit 8a7dc18
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: SGP
Type: Package
Title: Student Growth Percentiles & Percentile Growth Trajectories
Version: 2.2-0.1
Version: 2.2-0.2
Date: 2024-10-10
Authors@R: c(person(given=c("Damian", "W."), family="Betebenner", email="[email protected]", role=c("aut", "cre")),
person(given=c("Adam", "R."), family="Van Iwaarden", email="[email protected]", role="aut"),
Expand Down
7 changes: 2 additions & 5 deletions R/createSuperCohortData.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
function(
base_data,
sgp.config,
target_years, ## Provide either target_years OR num_priors. length(target_years) = num_priors + 1
num_priors, ## Provide either num_priors OR target_years. num_priors = length(target_years) - 1
supercohort_base_years, ## Subset of years of supplied_base data to use for super-cohort construction
indicate_cohort=FALSE
) {

Expand All @@ -12,9 +11,7 @@ function(
tmp.cohort.list <- list()

### Test parameters
if (missing(target_years) & missing(num_priors)) stop("Provide either targets years for super-cohort or number of priors of desired SGP analyses.")
if (missing(target_years) & !missing(num_priors)) target_years <- tail(data.years, num_priors)
if (length(target_years) >= length(data.years)) stop("Super-cohort construction is possible only when number of target_years is less than number of years in supplied data.")
if (!missing(supercohort_base_years) && !all(supercohort_base_years %in% data.years)) stop("Note: supercohort_base_years supplied not all in years provided in base_data.")

### Loop over configurations
for (sgp.config.iter in sgp.config) {
Expand Down
2 changes: 1 addition & 1 deletion man/SGP-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ growth projections to be calculated across assessment transitions by equating th
\tabular{ll}{
Package: \tab SGP\cr
Type: \tab Package\cr
Version: \tab 2.2-0.1\cr
Version: \tab 2.2-0.2\cr
Date: \tab 2024-10-10\cr
License: \tab GPL-3\cr
LazyLoad: \tab yes\cr
Expand Down

0 comments on commit 8a7dc18

Please sign in to comment.