Learn R Programming

ptvalue (version 0.2.0)

times: Create times or div vector of class ptvalue

Description

times() and div() are convenient and stricter functions for creating growing or decaying precision teaching values with numeric values greater or equal than 1 (or otherwise raise an error).

Usage

times(x = double())

div(x = double())

Value

A numeric vector of class ptvalue that represent precision teaching measures.

Arguments

x

A numeric vector. Values must be greater or equal than 1.

Details

Note that providing a vector of class ptvalue to times() or div() will raise an error as these functions are stricter.

Examples

Run this code
x <- c(1, 2, 4)
times(x)
div(x)

# `div()` can be useful for specifying div values without
#   the need to convert them first into values under zero
ptvalue(c(0.25, 0.5, 1, 2, 4))
ptvalue(c(div(4), div(2), 1, 2, 4))

Run the code above in your browser using DataLab