metric_to_grid: reshape a set of values to a matrix with axes defined by X...

Description Usage Arguments Value Examples

View source: R/HTDoseResponseCurve.R

Description

Useful for extracting two columns out of a data frame that will serve as column and row names, with a third column that will represent the value at that (row, column). The pairs identified by x_axis_labels,y_axis_labels should be unique; if not, the last value seen will be used.

Usage

1
metric_to_grid(x_axis_labels, y_axis_labels, values)

Arguments

x_axis_labels

vector of values that define the X axis

y_axis_labels

vector of values that define the Y axis

values

value to position at (X,Y) defined by the labels

Value

Matrix with columns named for x_axis_labels, rows named for y_axis_labels, and elements corresponding to the values parameter. X and Y labels will be sorted.

Examples

1
2
3
4
xlab = c("a","a","a","b","b","b","c","c","c")
ylab = c("x","y","z","x","y","z","x","y","z")
vals = c(1, 2 , 3 , 4 , 5 , 6 , 7 , 8, 9)
metric_to_grid(xlab, ylab, vals)

DavidQuigley/HTDoseResponseCurve documentation built on Jan. 23, 2021, 5:10 a.m.