vfractional: Vectorized form for fractional

Description Usage Arguments Value Examples

View source: R/vfractional.R

Description

A function which allows any or all of the first three arguments of fractional to be vectors, with short vectors recycled in the usual way. Note that the return value is a character string vector and may not be used in arithmetic operations

Usage

1
vfractional(x, eps = 1e-06, maxConv = 20)

Arguments

x

as for fractional

eps

as for fractional, but may be a vector

maxConv

as for fractional but may be a vector

Value

A character string vector of class "charFrac"

Examples

1
2
3
4
5
6
7
8
oldOpt <- options(scipen = 15)
pi_approx <- vfractional(base::pi, eps = 0, maxConv = 1:10)
within(data.frame(pi_approx, stringsAsFactors = FALSE), {
  value = numerical(pi_approx)
  error = signif(base::pi - value, 3)
  n = seq_along(value) - 1
})[, c("n", "pi_approx", "value", "error")]
options(oldOpt)

fractional documentation built on May 2, 2019, 4:16 a.m.