Learn R Programming

registr (version 2.1.0)

coarsen_index: Coarsen an index vector to a given resolution

Description

Reduce the resolution of a numeric vector by specifying the number of significant_digits to which the numbers should be rounded.

Internal function used to coarsen the index vector before estimating the two-step GFPCA with gfpca_twoStep.

Usage

coarsen_index(index, significant_digits)

Value

Numeric vector of rounded index values.

Arguments

index

Numeric vector of index values.

significant_digits

Positive integer value.

Examples

Run this code
index_vector = c(0.7892, 0.2984, 0.328)
registr:::coarsen_index(index_vector, 1)
registr:::coarsen_index(index_vector, 3)

index_vector2 = c(2803, -7639, 13)
registr:::coarsen_index(index_vector2, 1)
registr:::coarsen_index(index_vector2, 3)

Run the code above in your browser using DataLab