Package 'FRACTION'

Title: Numeric Number into Fraction
Description: Turn numeric,data.frame,matrix into fraction form.
Authors: OuYang Ming <[email protected]>
Maintainer: OuYang Ming <[email protected]>
License: GPL-2
Version: 1.1.1
Built: 2024-11-16 06:23:31 UTC
Source: CRAN

Help Index


Numeric Number into Fraction

Description

Turn numeric,data.frame,matrix into fraction form.

Details

Package: FRACTION
Type: Package
Version: 1.1.1
Date: 2023-08-21
License: licenseInfo

Author(s)

OuYang Ming Maintainer: OuYang Ming <[email protected]>

References

Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows FAQ in R-PROJECT

Examples

r=8
is.wholenumber(r)
a=14
b=32
c=gcd(a,b)
x=1/6
fra(x)
y=c(1/2,1/3,1/9)
fra.m(y)
z=data.frame(1/2)
fra.m(z)
q=matrix(1)
fra.m(q)

FRACTION for number

Description

to turn numeric number into fraction form

Usage

fra(x, j = 7)

Arguments

x

a numeric number

j

Decimal digits default is 7

Value

Return a charerter which shows the fraction equals x, x is a number

Author(s)

OuYang Ming

References

Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows

Examples

x=1/3
fra(x)

FRACTION for vector, matrix or data.frame

Description

to turn vector, data.frame, matrix into fraction form

Usage

fra.m(x)

Arguments

x

Vector, matrix or data.frame which contains numeric number

Value

Return a charerter which shows the fraction equals x, x is a data.frame or matrix or vector

Author(s)

OuYang Ming

References

Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows

Examples

y=c(1/2,1/3,1/9)
fra.m(y)
z=data.frame(1/2)
fra.m(z)
q=matrix(1)
fra.m(q)

Greatest common divisor

Description

Calculate the greatest common divisor between two numbers

Usage

gcd(a, b)

Arguments

a

a is greater than 0 while a is whole number

b

b is greater than 0 while b is whole number

Details

Ues Euclidean algorithm

Value

the greatest common divisor between a and b

Author(s)

OuYang Ming

References

Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows FAQ in R-PROJECT

Examples

a=14
b=32
c=gcd(a,b)

To judge the number is whole number or not

Description

To judge the number is whole number or not

Usage

is.wholenumber(x, tol = .Machine$double.eps^0.5)

Arguments

x

x is a numeric number

tol

Define in function

Value

Return TRUE or FALSE to judge x is whole number or not

Author(s)

OuYang Ming

References

Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows FAQ in R-PROJECT

Examples

r=8
is.wholenumber(r)