precision: Precisions

Description Usage Arguments Details Value Examples

View source: R/dataframes.R

Description

Get or set precisions of columns on a data frame

Usage

1
2

Arguments

col

a column in a data frame

value

a two-element numeric vector, or NULL if no precision is set

Details

In EDP, numeric columns in a population have optional "precisions," which are two-element numeric values. Either the first or second must be 1. The other must be a positive integer (which may also be one). For example, c(100, 1) means the column is measured in units of hundreds, and c(1, 4) means the column is measured in units of 0.25.

These functions get and set the precision on a data frame column you will build a population from; you can also get the precision of a column from select or simulate.

Value

a two-element numeric vector

Examples

1
2
3
4
5
  d <- data.frame(x = c(1.0, 2.5, -2.5), y = runif(3))
  precision(d$x) <- c(1, 2)
  px <- precision(d$x)  # returns c(1, 2)
  py <- precision(d$y)  # returns NULL
  

edpclient documentation built on May 2, 2019, 2:01 p.m.