Skip to contents

Sets a variable to a target value at a specific year (optionally restricted to a set of sites). Errors if it would overwrite an existing non-`NA` value.

Usage

set_change_point(x, var, year, target, sites = NULL)

Arguments

x

An intervention implementation data.frame

var

Variable to modify

year

Year of change point

target

New value of change point

sites

Site reference to modify at (a data.frame of grouping columns). If `NULL` the change point is applied across all sites.