make_new_data: make_new_data: Generates a new dataset varying in the...

View source: R/prepare_for_plotting.R

make_new_dataR Documentation

make_new_data: Generates a new dataset varying in the dimension of interest.

Description

Generates a new dataset to feed into the plotting functions (plot_transfers)

Usage

make_new_data(
  from_part,
  to_part,
  fixed_values,
  dataset,
  units = NULL,
  specified_units = NULL,
  comp_labels,
  lower_quantile = 0.05,
  upper_quantile = 0.95,
  granularity = 10000
)

Arguments

from_part

Should be an element of comp_labels.

to_part

Should be an element of comp_labels.

fixed_values

If terms = FALSE, this gives the fixed values of the non-compositional covariates at which to calculate the prediction. It is generated automatically if not set. It does not usually need setting, and makes no difference to the output if 'terms = TRUE'.

dataset

Dataset to use to inform range of data used (should be dataset model was developed on)

units

What should the units of the compositional variables be in any output? Currently available are "unitless" (where working in terms of proportions), "hr/day", "hr/wk", "min/day", "min/wk" and "specified", in which case the specified_units argument should be set. Note that this doesn't specify the input units, as this is not relevant for any function.

specified_units

If units are being specified via the composition sum, this is where it is done. It should be a vector where the first argument is a string describing the units, and the second argument is the expected sum of a composition e.g. c("hr/day", 24)

comp_labels

The labels of the compositional columns.

lower_quantile

If set, this gives the lower limit of plotting (as a quantile for both variables of interest). In practice, the current behaviour is to calculate the range of both variables between the upper and lower quantile, and use the narrower one.

upper_quantile

If set, this gives the upper limit of plotting (as a quantile for both variables of interest).

granularity

Does not usually require setting. If set, gives the number of points plotted on the graph. If it is too low, the plot will contain gaps. If it is too high, plotting will be slow.


OxWearables/epicoda documentation built on Dec. 7, 2022, 9:07 p.m.