2
2
function (sgp_object ,
3
3
additional.data = NULL ,
4
4
state = NULL ,
5
- content_areas = c(" MATHEMATICS" , " MATHEMATICS_SPANISH" , " READING" , " READING_SPANISH" , " READING_UNIFIED" , " EARLY_LITERACY" , " EARLY_LITERACY_SPANISH" ),
5
+ content_areas = c(' MATHEMATICS' , ' MATHEMATICS_SPANISH' , ' READING' , " READING_SPANISH" , " READING_UNIFIED" , " EARLY_LITERACY" , " EARLY_LITERACY_SPANISH" ),
6
6
testing.window = NULL , # ## FALL, WINTER, SPRING
7
+ testing.window.type = NULL , # ## FALL: FF, WSF/SF; WINTER: SFW/FW; SPRING: FWS/WS, SS, FS
7
8
eow.or.update = " UPDATE" , # ## UPDATE or EOW
8
9
update.save.shell.only = FALSE ,
9
10
configuration.year = NULL ,
@@ -41,9 +42,6 @@ function(sgp_object,
41
42
42
43
if (! score.type %in% c(" RASCH" , " STAR" )) stop(" \t NOTE: 'score.type argument must be set to either RASCH or STAR.'" )
43
44
44
- if (score.type == " STAR" ) content_areas <- setdiff(content_areas , c(" EARLY_LITERACY_SPANISH" , " MATHEMATICS_SPANISH" , " READING_SPANISH" , " READING_UNIFIED" ))
45
-
46
-
47
45
# ## Utility functions
48
46
49
47
convertToBaseline <- function (baseline_matrices ) {
@@ -85,10 +83,11 @@ function(sgp_object,
85
83
}
86
84
}
87
85
88
- getRLIConfig <- function (content_areas , configuration.year , testing.window , score.type ) {
86
+ getRLIConfig <- function (content_areas , configuration.year , testing.window , testing.window.type , score.type ) {
89
87
tmp.list <- list ()
90
88
for (i in content_areas ) {
91
89
tmp.list [[i ]] <- SGPstateData $ RLI $ SGP_Configuration $ sgp.config.function $ value(configuration.year , i , testing.window , score.type )
90
+ if (! is.null(testing.window.type )) tmp.list [[i ]] <- tmp.list [[i ]][grep(testing.window.type , names(tmp.list [[i ]]))]
92
91
}
93
92
if (score.type == " RASCH" ) setattr(tmp.list , " names" , paste(names(tmp.list ), " RASCH" , sep = " _" ))
94
93
return (unlist(tmp.list , recursive = FALSE ))
@@ -222,7 +221,7 @@ function(sgp_object,
222
221
fix.duplicates = fix.duplicates ,
223
222
get.cohort.data.info = get.cohort.data.info ,
224
223
parallel.config = parallel.config ,
225
- sgp.config = getRLIConfig(content_areas , configuration.year , testing.window , score.type ))
224
+ sgp.config = getRLIConfig(content_areas , configuration.year , testing.window , testing.window.type , score.type ))
226
225
227
226
if (! is.null(update.ids )) {
228
227
assign(update.shell.name , sgp_object )
@@ -278,7 +277,7 @@ function(sgp_object,
278
277
sgp.percentiles.calculate.sgps = eow.calculate.sgps ,
279
278
get.cohort.data.info = get.cohort.data.info ,
280
279
parallel.config = parallel.config ,
281
- sgp.config = getRLIConfig(content_areas , configuration.year , testing.window , score.type ))
280
+ sgp.config = getRLIConfig(content_areas , configuration.year , testing.window , testing.window.type , score.type ))
282
281
283
282
# ## Create and save new UPDATE_SHELL
284
283
@@ -299,7 +298,8 @@ function(sgp_object,
299
298
new.matrices <- convertToBaseline(sgp_object @ SGP $ Coefficient_Matrices [grep(configuration.year , names(sgp_object @ SGP $ Coefficient_Matrices ))])
300
299
old.matrix.label <- paste0(paste(state , " SGPt_Baseline_Matrices" , sep = " _" ), " $" , tail(sort(names(get(paste(state , " SGPt_Baseline_Matrices" , sep = " _" )))), 1L ))
301
300
old.matrices <- eval(parse(text = old.matrix.label ))
302
- if (score.type == " RASCH" ) tmp.content_areas <- paste0(c(" EARLY_LITERACY" , " EARLY_LITERACY_SPANISH" , " MATHEMATICS" , " MATHEMATICS_SPANISH" , " READING" , " READING_SPANISH" , " READING_UNIFIED" ), " _RASCH.BASELINE" ) else tmp.content_areas <- paste0(c(" EARLY_LITERACY" , " MATHEMATICS" , " READING" ), " .BASELINE" )
301
+ tmp.content_areas <- c(" EARLY_LITERACY" , " EARLY_LITERACY_SPANISH" , " MATHEMATICS" , " MATHEMATICS_SPANISH" , " READING" , " READING_SPANISH" , " READING_UNIFIED" )
302
+ if (score.type == " RASCH" ) tmp.content_areas <- paste0(tmp.content_areas , " _RASCH.BASELINE" ) else tmp.content_areas <- paste0(tmp.content_areas , " .BASELINE" )
303
303
year.to.replace <- head(sort(unique(sapply(lapply(sapply(names(old.matrices [[" READING_RASCH.BASELINE" ]]), strsplit , ' [.]' ), ' [' , 2 : 3 ), paste , collapse = " ." ))), 1L )
304
304
for (content_area.iter in tmp.content_areas ) {
305
305
old.matrices [[content_area.iter ]][grep(year.to.replace , names(old.matrices [[content_area.iter ]]))] <- NULL
0 commit comments