run_regression_tree: Run the regression tree analysis with specified number of...

View source: R/run.regression.tree.R

run_regression_treeR Documentation

Run the regression tree analysis with specified number of splits

Description

run.regression.tree This function is the main regression tree function

Usage

run_regression_tree(
  LF,
  fcol,
  lcol,
  bins,
  Nsplit,
  save_dir,
  manual = FALSE,
  select = NA,
  lat.min = 1,
  lon.min = 1,
  year.min = 1,
  quarter = TRUE,
  year = FALSE,
  include_dummy = FALSE,
  pdf = FALSE,
  lf_scale = 1.5
)

Arguments

LF

The length frequency data frame input; must include four columns: lat, lon, year, and quarter

fcol

The first column in the data frame with length frequency info

lcol

The last column in the data frame with length frequency info

bins

Names of all bins included in LF

Nsplit

The number of splits

save_dir

The directory where results will be saved

manual

Whether to use user-specified splits; default = FALSE

select

User-specified splits; default = NA

lat.min

Minimal number of lat grids allowed for a cell, which could not be split beyond that

lon.min

Minimal number of lon grids allowed for a cell, which could not be split beyond that

year.min

Minimal number of years allowed for a cell, which could not be split beyond that

quarter

Whether to consider quarter as a splitting dimension; default = TRUE

year

Whether to consider year as a splitting dimension; default = FALSE

include_dummy

Whether to include dummy data; default = FALSE

pdf

Whether to save figures in pdf - default is in png

lf_scale

scale mean lf plot

Value

return the input LF with cell number and the percentage of total LF variance explained by each split


HaikunXu/RegressionTree documentation built on Jan. 25, 2025, 12:08 a.m.