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 |
Turn numeric,data.frame,matrix into fraction form.
Package: | FRACTION |
Type: | Package |
Version: | 1.1.1 |
Date: | 2023-08-21 |
License: | licenseInfo |
OuYang Ming Maintainer: OuYang Ming <[email protected]>
Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows FAQ in R-PROJECT
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)
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)
to turn numeric number into fraction form
fra(x, j = 7)
fra(x, j = 7)
x |
a numeric number |
j |
Decimal digits default is 7 |
Return a charerter which shows the fraction equals x, x is a number
OuYang Ming
Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows
x=1/3 fra(x)
x=1/3 fra(x)
to turn vector, data.frame, matrix into fraction form
fra.m(x)
fra.m(x)
x |
Vector, matrix or data.frame which contains numeric number |
Return a charerter which shows the fraction equals x, x is a data.frame or matrix or vector
OuYang Ming
Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows
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)
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)
Calculate the greatest common divisor between two numbers
gcd(a, b)
gcd(a, b)
a |
a is greater than 0 while a is whole number |
b |
b is greater than 0 while b is whole number |
Ues Euclidean algorithm
the greatest common divisor between a and b
OuYang Ming
Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows FAQ in R-PROJECT
a=14 b=32 c=gcd(a,b)
a=14 b=32 c=gcd(a,b)
To judge the number is whole number or not
is.wholenumber(x, tol = .Machine$double.eps^0.5)
is.wholenumber(x, tol = .Machine$double.eps^0.5)
x |
x is a numeric number |
tol |
Define in function |
Return TRUE or FALSE to judge x is whole number or not
OuYang Ming
Friedrich Leisch, 2008 Creating R packages: A Tutorial Zhang Jinlong, How to create R package under Windows FAQ in R-PROJECT
r=8 is.wholenumber(r)
r=8 is.wholenumber(r)