add_accelerated_growth: Add an accelerated growth object, including projections and...

Description Usage Arguments Value Examples

View source: R/goals_and_projections.R

Description

add_accelerated_growth is a constructor function that adds a "goals" object (a list with a goals data frame, a join_by_fields character vector, and slot_name single element character vector) to a mapvizieR object. The goals object is added to a goals slot in the mapvizieR object. The goals themselves, as well as any projections or simulations, are created by a "goals function" (see goal_kipp_tiered for an example) that is passed as the goal_function argument; arguments to the goal_function are passed via the goal_function_args argument. Note well that the goal_function must (i) return a list with three elements (the goals data frame, the join_by_fields character vector, and the slot_name) and (ii) the goals data frame must have at least fields named accel_growth and met_accel_growth. If the updated_growth_df is TRUE then the goals data frame is inner_joined with the growth_df using the join_by_fields, accelerated growth columns are added or updated, and any duplicate columns from the join are cleaned up (original columns from the growth_df are maintened). Obviouslly, the goals function should return a one to one match on any first iterations.

Usage

1
2
add_accelerated_growth(mapvizier_object, goal_function = goal_kipp_tiered,
  goal_function_args = list(iterations = 1), update_growth_df = FALSE)

Arguments

mapvizier_object

a mapvizieR object.

goal_function

a function that returns a list containing a a data frame named goals, a character vector of columns used to join accelerated goals to growth_df, and slot_name single element character vector used to name the slot in the goals element of a mapvizieR object.

goal_function_args

arguments passed to goal_function

update_growth_df

if TRUE accelerated growth and met accelerated growth columns are added/updated in the growth_df of a mapvizieR object

Value

a mapvizieR object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
data(ex_CombinedAssessmentResults)
data(ex_CombinedStudentsBySchool)

cdf_mv <- mapvizieR(
 ex_CombinedAssessmentResults, 
 ex_CombinedStudentsBySchool
)
                    
new_mv <- add_accelerated_growth(
 cdf_mv,
 goal_function = goal_kipp_tiered, 
 goal_function_args = list(iterations=1),
 update_growth_df = FALSE
)
str(new_mv)                                

## End(Not run)

almartin82/mapvizieR documentation built on Sept. 3, 2017, 7:52 a.m.