param_grid: Make all combinations of parameters for parameter matrix

View source: R/param_grid.R

param_gridR Documentation

Make all combinations of parameters for parameter matrix

Description

This takes a df of parameter ranges generated by param_ranges() and applied param_seqs() to turn any that vary into a sequence spanning the range. These sequences (if any) are then turned into a matrix of all possible values if none vary, then a single row of data is returned

Usage

param_grid(param.seqs = param_seqs(param_ranges(figure = 28.3)))

Arguments

param.seqs

sequence of parameters to use (in form of vector)

Value

param.grid Dataframe of parameter combinations

Examples


# "Grid" with no variation = single row of data
param_grid()

# Grid with variation

##Generate parameters for Figure 28.2
param.ranges <- param_ranges(figure = 28.3)

##generate parameter sequences
param.seqs <- param_seqs(param.ranges = param.ranges)
param.seqs[1:3]

##generate grid
param.grid <- param_grid(param.seqs)

## look at snippet of raw data
param.grid[1:10,1:5]

## look at summary of columns that vary
summary(param.grid[,c("K.bc","K.bk","K.wg" )])

## conver colums that vary to factors then look at them
param.grid$K.bc <- factor(param.grid$K.bc)
param.grid$K.bk <- factor(param.grid$K.bk)
param.grid$K.wg <- factor(param.grid$K.wg)

summary(param.grid[,c("K.bc","K.bk","K.wg" )],10)

brouwern/FACavian documentation built on March 23, 2022, 10:07 a.m.