Learn R Programming

estar (version 1.0-1)

sort_response: Organize the response variable upon which the stability metric will be calculated

Description

Organize the response variable upon which the stability metric will be calculated

Usage

sort_response(response, dts_df, vb_i, tb_i, b_data)

Value

A dataframe with the response variable calculated over time.

Arguments

response

a string stating whether the values of the state variable in the disturbed scenario (response == "v") or its log ratio in relation to baseline should be taken as the response used to calculate the metric.

dts_df

the internal dataframe composed from the inputs regarding the disturbed scenario

vb_i

a numeric vector containing the state variable in the baseline, a string for the name of the column in b_data containing said variable in the baseline, or default NULL, if a separate baseline is not being used.

tb_i

an optional numeric vector containing the time steps for which the baseline was measured, or a string containing the name of the column in b_data.

b_data

an optional data frame containing the time-series of the baseline values of the state variable. Time and value columns must be named tb_i and vb_i, respectively.