numerators: Extract the parts of a fractional object

Description Usage Arguments Value Methods (by class) Examples

View source: R/vfractional.R

Description

Generic function for extracting numerators with methods for "fractional" or "charFrac" objects

Generic function for extracting denominators with methods for "fractional" or "charFrac" objects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
numerators(x)

## S3 method for class 'charFrac'
numerators(x)

## S3 method for class 'fractional'
numerators(x)

## Default S3 method:
numerators(x)

denominators(x)

## S3 method for class 'charFrac'
denominators(x)

## S3 method for class 'fractional'
denominators(x)

## Default S3 method:
denominators(x)

Arguments

x

An object of class "fractional" or "charFrac"

Value

An integer vector of numerators

An integer vector of denominators

Methods (by class)

Examples

1
2
3
(pi_approx <- vfractional(base::pi, eps = 0, maxConv = 1:10))
numerators(pi_approx)
denominators(pi_approx)

Example output

 [1] 3              22/7           333/106        355/113        103993/33102  
 [6] 104348/33215   208341/66317   312689/99532   833719/265381  1146408/364913
 [1]       3      22     333     355  103993  104348  208341  312689  833719
[10] 1146408
 [1]      1      7    106    113  33102  33215  66317  99532 265381 364913

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