Skip to contents

S3 class for the result of a call to alternate(). Essentially a list with added run_map and further attributes.

Usage

cfp_altres(
  x,
  og_model,
  f,
  run_map,
  return_raw = TRUE,
  error_funs = NULL,
  error_args = NULL
)

Arguments

x

A named list of cfp_pfres or cfp_fgres models.

og_model

The original model that was altered

f

A function taking in a soilphys object and recalculates the relevant columns. See complete_soilphys().

run_map

A data.frame created by run_map() with the necessary information how the data is to be changed with each distinct run_id.

return_raw

Should the models be returned as is, or after applying any error_funs. Default is TRUE - exporting the models.

error_funs

A list of functions to be applied after flux calculation if return_raw == FALSE. This can be used to output not the models but quality parameters instead. Output must contain the column RMSE.

error_args

A list of additional function arguments to be passed to any of the error_funs. Must match the length of error_funs

Value

A list of mdoel results of type cfp_altres.

See also

Other model frames: cfp_fgmod(), cfp_fgres(), cfp_pfmod(), cfp_pfres()

Examples

# internal
PROFLUX <- ConFluxPro::base_dat |> pro_flux()

cfp_altres(list(PROFLUX), PROFLUX, complete_soilphys, data.frame(run_id = 1))
#> 
#> A cfp_altres model result list. 
#> number of runs:  1 
#> original model: 
#> 
#> A cfp_pfres pro_flux model result. 
#> mean RMSE achieved:  0.035769 
#> number of failed fits:  0 
#> 
#> A cfp_pfmod pro_flux model. 
#> zero_flux: TRUE  
#> zero_limits:  -Inf Inf  
#> DSD0_optim:  FALSE  
#> evenness_factor:  0  
#> known_flux_factor:  0  
#> 
#> A cfp_dat object to be used as input in ConFluxPro models. 
#> id_cols: site Date gas 
#> number of profiles:  24 
#> number of groups:  2 
#>