normalize_to_first_timepoint: Normalize a time-indexed vector of values its first value.

Description Usage Arguments Value Author(s) References Examples

View source: R/normalize_to_first_timepoint.R

Description

From a data.frame, extract a y-vector of responses and their x-vector of observation times. Normalize the y-vector to its first (based on the x-values) observation, subtract out the centering value from the entire normalized vector, and return the normalized, centered vector.

Usage

1
2
3
4
5
6
7
8
normalize_to_first_timepoint(
  DATA_FRAME,
  x_name = "x",
  y_name = "y",
  average_multiple_obs = TRUE,
  centering_value = 1,
  scale_value = 100
)

Arguments

DATA_FRAME

data.frame with x-values (i.e, time-values) and y-values (responses.

x_name

character string with name of time value that order the responses.

y_name

character string with name of responses to be normalized to their own temporal baseline value.

average_multiple_obs

logical should we allow averaging of multiple baseline values, or call an error?

centering_value

numeric value to subtract from the normalized vector.

scale_value

numeric value by which to re-scale the normalized, centered vector.

Value

A numeric vector with normalized values.

Author(s)

Bill Forrest <forrest@gene.com>

Bill Forrest forrest@gene.com

References

www.r-project.org

Examples

1
2
3
4
5
6
normalizing_test_data <- data.frame( x = seq(0,1,length = 11) )
normalizing_test_data$y <- 1 + 2 * exp(-normalizing_test_data$x)
normalized_output <-
  data.frame( normalizing_test_data,
              y_norm = maeve:::normalize_to_first_timepoint( normalizing_test_data )
             )

wfforrest/maeve documentation built on Jan. 1, 2021, 12:47 p.m.