View source: R/add_model_preds.R
drop_and_pivot | R Documentation |
A helper function to add_predictions
drop_and_pivot(
by_var,
drop_raw = TRUE,
temperature_col = c("Temperature_norm"),
keep_data_cols = c("resid", "pred"),
...
)
by_var |
A nested tibble, as output by add_nls() |
drop_raw |
A boolean, specifying whether or not to drop unnecessary columns from data. Defaults to TRUE, which minimizes output size, but requires re-joining with layouts after fitting for exploratory data analysis and plotting. |
temperature_col |
a character vector containing, as a string, the name of the column containing normalized Temperature. Defaults to c("Temperature_norm"). Could also include non-normalized Temperature (e.g. c("Temperature_norm", "Temperature")), but this is currently not particularly well supported by the downstream functions. |
keep_data_cols |
a character vector containing, as strings, the names of the columns to retain in the data tibble. Defaults to resid, and pred, which contain the residuals and predictions output by modelr::add_predictions(). |
... |
additional arguments to be passed to downstream functions. |
the data tibble, with unnneded columns removed, and converted to long-form, with columns Temperature_norm, which_value (contents include "resid" and "pred"), and value.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.