R# math module
math
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| floor | 1 | Rounding of Numbers floor takes a single numeric argument x and returns a numeric vector containing the largest integers not greater than the corresponding elements of x. |
| ceiling | 1 | Rounding of Numbers ceiling takes a single numeric argument x and returns a numeric vector containing the smallest integers not less than the corresponding elements of x. |
| trunc | 1 | Rounding of Numbers trunc takes a single numeric argument x and returns a numeric vector containing the integers formed by truncating the values in x toward 0. |
| sign | 1 | Sign Function sign returns a vector with the signs of the corresponding elements of x (the sign of a real number is 1, 0, or -1−1 if the number is positive, zero, or negativ… |
| isNaN | 1 | Finite, Infinite and NaN Numbers is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or in… |
| isFinite | 1 | Finite, Infinite and NaN Numbers is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or in… |
| isInfinite | 1 | Finite, Infinite and NaN Numbers is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or in… |
| diff | 1 | Lagged Differences Returns suitably lagged and iterated differences. |
| round | 1 | rounds the values in its first argument to the specified number of decimal places (default 0). |
| log | 1 | computes logarithms, by default natural logarithms, log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms. |
| log1p | 1 | Computes log(1+x) without losing precision for small values of x. |
| log1m | 1 | Computes log(1-x) without losing precision for small values of x. |
| log2 | 1 | Logarithms and Exponentials log2 computes binary (i.e., base 2) logarithms. |
| log10 | 1 | Logarithms and Exponentials log10 computes common (i.e., base 10) logarithms |
| cos | 1 | evaluate the cosine alpha |
| prod | 1 | Product of Vector Elements prod returns the product of all the values present in its arguments. |
| sum | 1 | Sum of Vector Elements sum returns the sum of all the values present in its arguments. |
| exp | 1 | Logarithms and Exponentials computes the exponential function. |
| max | 1 | |
| min | 1 | |
| mean | 1 | Arithmetic Mean |
| weighted_mean | 1 | Weighted Arithmetic Mean Compute a weighted mean. |
| median | 1 | Median Value Compute the sample median. |
| abs | 1 | abs(x) computes the absolute value of x |
| rsd | 1 | relative standard deviation Relative standard deviation is a common formula used in statistics and probability theory to determine a standardized measure of the ratio of the… |
| sd | 1 | Standard Deviation This function computes the standard deviation of the values in x. |
| pearson | 1 | Pearson Correlation Testing in R Programming Correlation is a statistical measure that indicates how strongly two variables are related. |
| cor_test | 1 | Test for Association/Correlation Between Paired Samples Test for association between paired samples, using one of Pearson's product moment correlation coefficient, Kendall's… |
| set_seed | 1 | set.seed is the recommended way to specify seeds. |
| getRandom | 1 | get a random number value between [0,1]. |
| runif | 1 | runif generates random deviates. |
| rexp | 1 | The Exponential Distribution Density, distribution function, quantile function and random generation for the exponential distribution with rate rate (i.e., mean 1/rate). |
| rnorm | 1 | The Normal Distribution Density, distribution function, quantile function and random generation for the normal distribution with mean equal to mean and standard deviation equa… |
| sample | 1 | Random Samples and Permutations sample takes a sample of the specified size from the elements of x using either with or without replacement. |
| sample_int | 1 | |
| cluster1D | 1 | grouping data input by given numeric tolerance |
| var | 1 | Correlation, Variance and Covariance (Matrices) var, cov and cor compute the variance of x and the covariance or correlation of x and y if these are vectors. |
| cor | 1 | Correlation, Variance and Covariance (Matrices) var, cov and cor compute the variance of x and the covariance or correlation of x and y if these are vectors. |
| lcm_r | 1 | Function to calculate the Least Common Multiple (LCM) |
| root | 1 | finds root of specific degree of number. |
| fit | 1 | |
| sin | 1 | |
| pow | 1 | |
| sqrt | 1 | |
| shuffle | 1 | |
| numericClassTags | 1 | |
| gcd | 1 |
03 Members
Object, Environment)Rounding of Numbers
floor takes a single numeric argument x and returns a numeric vector containing the largest integers not greater than the corresponding elements of x.
These are generic functions: methods can be defined for them individually or via the Math group generic.
Note that for rounding off a 5, the IEC 60559 standard (see also ‘IEEE 754’) is expected to be used, ‘go to the even digit’. Therefore round(0.5) is 0 and round(-1.5) is -2. However, this is dependent on OS services and on representation error (since e.g. 0.15 is not represented exactly, the rounding rule applies to the represented number and not to the printed number, and so round(0.15, 1) could be either 0.1 or 0.2).
Rounding to a negative number of digits means rounding to a power of ten, so for example round(x, digits = -2) rounds to the nearest hundred.
For signif the recognized values of digits are 1...22, and non-missing values are rounded to the nearest integer in that range. Complex numbers are rounded to retain the specified number of digits in the larger of the components. Each element of the vector is rounded individually, unlike printing.
These are all primitive functions.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector. Or, for round and signif, a complex vector. |
env | Environment | - |
Object, Environment)Rounding of Numbers
ceiling takes a single numeric argument x and returns a numeric vector containing the smallest integers not less than the corresponding elements of x.
These are generic functions: methods can be defined for them individually or via the Math group generic.
Note that for rounding off a 5, the IEC 60559 standard (see also ‘IEEE 754’) is expected to be used, ‘go to the even digit’. Therefore round(0.5) is 0 and round(-1.5) is -2. However, this is dependent on OS services and on representation error (since e.g. 0.15 is not represented exactly, the rounding rule applies to the represented number and not to the printed number, and so round(0.15, 1) could be either 0.1 or 0.2).
Rounding to a negative number of digits means rounding to a power of ten, so for example round(x, digits = -2) rounds to the nearest hundred.
For signif the recognized values of digits are 1...22, and non-missing values are rounded to the nearest integer in that range. Complex numbers are rounded to retain the specified number of digits in the larger of the components. Each element of the vector is rounded individually, unlike printing.
These are all primitive functions.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector. Or, for round and signif, a complex vector. |
env | Environment | - |
Object, Environment)Rounding of Numbers
trunc takes a single numeric argument x and returns a numeric vector containing the integers formed by truncating the values in x toward 0.
These are generic functions: methods can be defined for them individually or via the Math group generic.
Note that for rounding off a 5, the IEC 60559 standard (see also ‘IEEE 754’) is expected to be used, ‘go to the even digit’. Therefore round(0.5) is 0 and round(-1.5) is -2. However, this is dependent on OS services and on representation error (since e.g. 0.15 is not represented exactly, the rounding rule applies to the represented number and not to the printed number, and so round(0.15, 1) could be either 0.1 or 0.2).
Rounding to a negative number of digits means rounding to a power of ten, so for example round(x, digits = -2) rounds to the nearest hundred.
For signif the recognized values of digits are 1...22, and non-missing values are rounded to the nearest integer in that range. Complex numbers are rounded to retain the specified number of digits in the larger of the components. Each element of the vector is rounded individually, unlike printing.
These are all primitive functions.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector. Or, for round and signif, a complex vector. |
env | Environment | - |
Object, Environment)Sign Function
sign returns a vector with the signs of the corresponding elements of x (the sign of a real number is 1, 0, or -1−1 if the number is positive, zero, or negative, respectively).
Note that sign does not operate on complex vectors.
This is an internal generic primitive function: methods can be defined for it directly or via the Math group generic.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector |
env | Environment | - |
Object, Environment)Finite, Infinite and NaN Numbers
is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or infinite.
Inf And -Inf are positive And negative infinity whereas NaN means 'Not a Number’. (These apply to numeric values and real and imaginary parts of complex values but not to values of integer vectors.) Inf and NaN are reserved words in the R language.
is.nan tests if a numeric value is NaN. Do not test equality to NaN, or even use identical, since systems typically have many different NaN values. One of these is used for the numeric missing value NA, and is.nan is false for that value. A complex number is regarded as NaN if either the real or imaginary part is NaN but not NA. All elements of logical, integer and raw vectors are considered not to be NaN.
All three functions accept NULL As input And Return a length zero result. The Default methods accept character And raw vectors, And Return False For all entries. Prior To R version 2.14.0 they accepted all input, returning False For most non-numeric values; cases which are Not atomic vectors are now signalled As errors.
All three functions are generic: you can write methods To handle specific classes Of objects, see InternalMethods.
| Name | Type | Description |
|---|---|---|
x | Object | R object to be tested: the default methods handle atomic vectors. |
env | Environment | - |
A logical vector of the same length as x: dim, dimnames and names attributes are preserved.
Object, Environment)Finite, Infinite and NaN Numbers
is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or infinite.
| Name | Type | Description |
|---|---|---|
x | Object | R object to be tested: the default methods handle atomic vectors. |
env | Environment | - |
A logical vector of the same length as x: dim, dimnames and names attributes are preserved.
Object, Environment)Finite, Infinite and NaN Numbers
is.finite and is.infinite return a vector of the same length as x, indicating which elements are finite (not infinite and not missing) or infinite.
is.infinite returns a vector of the same length as x the jth element of which is TRUE if x[j] is infinite (i.e., equal to one of Inf or -Inf) and FALSE otherwise. This will be false unless x is numeric or complex. Complex numbers are infinite if either the real or the imaginary part is.
| Name | Type | Description |
|---|---|---|
x | Object | R object to be tested: the default methods handle atomic vectors. |
env | Environment | - |
A logical vector of the same length as x: dim, dimnames and names attributes are preserved.
Object)Lagged Differences
Returns suitably lagged and iterated differences.
is.finite returns a vector of the same length as x the jth element of which is TRUE if x[j] is finite (i.e., it is not one of the values NA, NaN, Inf or -Inf) and FALSE otherwise. Complex numbers are finite if both the real and imaginary parts are.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector Or matrix containing the values To be differenced. |
Object, Int32)rounds the values in its first argument to the specified number of decimal places (default 0). See 'Details' about "round to even" when rounding off a 5.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector. Or, for |
decimals | Int32 | integer indicating the number of decimal places ( |
Object, Double)computes logarithms, by default natural logarithms, log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with base base.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric or complex vector. |
newBase | Double | a positive or complex number: the base with respect to which logarithms are computed. Defaults to |
Object)Computes log(1+x) without losing precision for small values of x.
| Name | Type | Description |
|---|---|---|
x | Object | - |
Object)Computes log(1-x) without losing precision for small values of x.
| Name | Type | Description |
|---|---|---|
x | Object | - |
Object)Logarithms and Exponentials
log2 computes binary (i.e., base 2) logarithms.
| Name | Type | Description |
|---|---|---|
x | Object | - |
Object)Logarithms and Exponentials
log10 computes common (i.e., base 10) logarithms
| Name | Type | Description |
|---|---|---|
x | Object | - |
Object)evaluate the cosine alpha
| Name | Type | Description |
|---|---|---|
x | Object | - |
Object, Boolean)Product of Vector Elements
prod returns the product of all the values present in its arguments.
If na.rm is FALSE an NA value in any of the arguments will cause a value of NA to be returned, otherwise NA values are ignored. This is a generic function: methods can be defined for it directly or via the Summary group generic. For this to work properly, the arguments ... should be unnamed, and dispatch is on the first argument. Logical true values are regarded as one, false values as zero. For historical reasons, NULL is accepted and treated as if it were numeric(0).
| Name | Type | Description |
|---|---|---|
x | Object | numeric or complex or logical vectors. |
na_rm | Boolean | logical. Should missing values be removed? |
The product, a numeric (of type "double") or complex vector of length one. NB: the product of an empty set is one, by definition.
Object, Boolean)Sum of Vector Elements
sum returns the sum of all the values present in its arguments.
| Name | Type | Description |
|---|---|---|
x | Object | numeric or complex or logical vectors. |
Array)Logarithms and Exponentials
computes the exponential function.
| Name | Type | Description |
|---|---|---|
x | Array | a numeric or complex vector. |
| Name | Type | Description |
|---|---|---|
x | Object | - |
na_rm | Boolean | a logical indicating whether missing values should be removed. |
| Name | Type | Description |
|---|---|---|
x | Object | - |
na_rm | Boolean | a logical indicating whether missing values should be removed. |
Object, Boolean)Arithmetic Mean
| Name | Type | Description |
|---|---|---|
x | Object | An R object. Currently there are methods for numeric/logical vectors and date, date-time and time interval objects. Complex vectors are allowed for trim = 0, only. |
Object, Object)Weighted Arithmetic Mean
Compute a weighted mean.
This is a generic function and methods can be defined for the first argument x: apart from the default methods there are methods for the date-time classes "POSIXct", "POSIXlt", "difftime" and "Date". The default method will work for any numeric-like object for which [, multiplication, division and sum have suitable methods, including complex vectors.
If w is missing then all elements of x are given the same weight, otherwise the weights are normalized to sum to one (if possible: if their sum is zero or infinite the value is likely to be NaN).
Missing values in w are not handled specially and so give a missing value as the result. However, zero weights are handled specially and the corresponding x values are omitted from the sum.
| Name | Type | Description |
|---|---|---|
x | Object | an object containing the values whose weighted mean is to be computed. |
w | Object | a numerical vector of weights the same length as x giving the weights to use for elements of x. |
For the default method, a length-one numeric vector.
Object, Boolean)Median Value
Compute the sample median.
This is a generic function for which methods can be written. However, the default method makes use of is.na, sort and mean from package base all of which are generic, and so the default method will work for most classes (e.g., "Date") for which a median is a reasonable concept.
| Name | Type | Description |
|---|---|---|
x | Object | an object for which a method has been defined, or a numeric vector containing the values whose median is to be computed. |
na_rm | Boolean | a logical value indicating whether NA values should be stripped before the computation proceeds. |
The default method returns a length-one object of the same type as x, except when x is logical or integer of even length, when the result will be double.
If there are no values Or If na.rm = False And there are NA values the result Is NA Of the same type As x (Or more generally the result Of x[FALSE][NA]).
Object)abs(x) computes the absolute value of x
| Name | Type | Description |
|---|---|---|
x | Object | a numeric Or complex vector Or array. |
Object)relative standard deviation
Relative standard deviation is a common formula used in statistics and probability theory to determine a standardized measure of the ratio of the standard deviation to the mean. This formula is useful in various situations including when comparing your own data to other related data and in financial settings such as the stock market.
Relative standard deviation, which also may be referred to as RSD or the coefficient of variation, is used to determine if the standard deviation of a set of data is small or large when compared to the mean. In other words, the relative standard deviation can tell you how precise the average of your results is. This formula is most frequently used in chemistry, statistics and other math-related settings but can also be used in the business world when assessing finances and the stock market.
The relative standard deviation Of a Set Of data can be depicted As either a percentage Or As a number. The higher the relative standard deviation, the more spread out the results are from the mean Of the data. On the other hand, a lower relative standard deviation means that the measurement Of data Is more precise.
| Name | Type | Description |
|---|---|---|
x | Object | - |
Object, Boolean)Standard Deviation
This function computes the standard deviation of the values in x. If na.rm is TRUE then missing values are removed before computation proceeds.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector or an R object but not a factor coercible to numeric by as.double(x) |
sample | Boolean | sample or population |
Pearson Correlation Testing in R Programming
Correlation is a statistical measure that indicates how strongly two variables are related. It involves the relationship between multiple variables as well. For instance, if one is interested to know whether there is a relationship between the heights of fathers and sons, a correlation coefficient can be calculated to answer this question. Generally, it lies between -1 and +1. It is a scaled version of covariance and provides the direction and strength of a relationship.
this function measure a Parametric Correlation – Pearson correlation(r): It measures a linear dependence between two variables (x and y) is known as a parametric correlation test because it depends on the distribution of the data.
Pearson Rank Correlation is a parametric correlation. The Pearson correlation coefficient is probably the most widely used measure for linear relationships between two normal distributed variables and thus often just called "correlation coefficient".
| Name | Type | Description |
|---|---|---|
x | Object | - |
y | Object | - |
MAXIT | Int32 | - |
- r takes a value between -1 (negative correlation) and 1 (positive correlation).
- r = 0 means no correlation.
- Can Not be applied to ordinal variables.
- The sample size should be moderate (20-30) For good estimation.
- Outliers can lead To misleading values means Not robust With outliers.
Test for Association/Correlation Between Paired Samples
Test for association between paired samples, using one of Pearson's product moment correlation coefficient, Kendall's \tauτ or Spearman's \rhoρ.
| Name | Type | Description |
|---|---|---|
x | Double() | numeric vectors of data values. x and y must have the same length. |
y | Double() | numeric vectors of data values. x and y must have the same length. |
env | Object | - |
Int32)set.seed is the recommended way to specify seeds.
set.seed returns NULL, invisibly.
| Name | Type | Description |
|---|---|---|
seed | Int32 | a single value, interpreted as an integer, or NULL (see ‘Details’). |
get a random number value between [0,1].
Int32, Double, Double)runif generates random deviates.
| Name | Type | Description |
|---|---|---|
n | Int32 | number of observations. If length(n) > 1, the length is taken to be the number required. |
min | Double | lower And upper limits of the distribution. Must be finite. |
max | Double | lower And upper limits of the distribution. Must be finite. |
Int32, Double)The Exponential Distribution
Density, distribution function, quantile function and random generation for the exponential distribution with rate rate (i.e., mean 1/rate).
| Name | Type | Description |
|---|---|---|
n | Int32 | number of observations. If length(n) > 1, the length is taken to be the number required. |
rate | Double | vector of rates. |
Int32, Double, Double)The Normal Distribution
Density, distribution function, quantile function and random generation for the normal distribution with mean equal to mean and standard deviation equal to sd.
dnorm gives the density, pnorm gives the distribution function, qnorm gives the quantile function, and rnorm generates random deviates.
| Name | Type | Description |
|---|---|---|
n | Int32 | number of observations. If length(n) > 1, the length is taken to be the number required. |
mean | Double | vector of means. |
sd | Double | vector of standard deviations. |
Random Samples and Permutations
sample takes a sample of the specified size from the elements of x using either with or without replacement.
If x has length 1, is numeric (in the sense of is.numeric) and x >= 1, sampling via sample takes place from 1:x. Note that this convenience feature may lead to undesired behaviour when x is of varying length in calls such as sample(x). See the examples.
Otherwise x can be any R Object For which length And subsetting by integers make sense: S3 Or S4 methods for these operations will be dispatched as appropriate.
For sample the default for size Is the number of items inferred from the first argument, so that sample(x) generates a random permutation of the elements of x (Or 1:x).
It Is allowed to ask for size = 0 samples with n = 0 Or a length-zero x, but otherwise n > 0 Or positive length(x) Is required.
Non-integer positive numerical values of n Or x will be truncated to the next smallest integer, which has to be no larger than .Machine$integer.max.
The optional prob argument can be used to give a vector of weights for obtaining the elements of the vector being sampled. They need Not sum to one, but they should be non-negative And Not all zero. If replace Is true, Walker's alias method (Ripley, 1987) is used when there are more than 200 reasonably probable values: this gives results incompatible with those from R < 2.2.0.
If replace Is False, these probabilities are applied sequentially, that Is the probability Of choosing the Next item Is proportional To the weights amongst the remaining items. The number Of nonzero weights must be at least size In this Case.
| Name | Type | Description |
|---|---|---|
x | Object | either a vector Of one Or more elements from which To choose, Or a positive Integer. See 'Details.’ |
size | Object | a non-negative integer giving the number of items to choose. |
replace | Boolean | should sampling be with replacement? |
prob | Object | a vector Of probability weights For obtaining the elements Of the vector being sampled. |
For sample a vector of length size with elements drawn from either x or from the integers 1:x.
Int32, Object, Boolean, Object)| Name | Type | Description |
|---|---|---|
n | Int32 | - |
size | Object | - |
replace | Boolean | - |
prob | Object | - |
returns an integer vector that could be used for represents the element index the generated integer vector in this function is base from 1
grouping data input by given numeric tolerance
| Name | Type | Description |
|---|---|---|
sequence | Object | - |
eval | Object | this parameter should be a lambda function which evaluate a numeric value for each elements in the given sequence data. |
offset | Double | the max tolerance error of the cluster data |
env | Environment | - |
Object, Object, Boolean, varUseMethods)Correlation, Variance and Covariance (Matrices)
var, cov and cor compute the variance of x and the covariance or correlation of x and y if these are vectors. If x and y are matrices then the covariances (or correlations) between the columns of x and the columns of y are computed.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector, matrix or data frame. |
y | Object | NULL (default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient). |
na_rm | Boolean | logical. Should missing values be removed? |
use | varUseMethods | an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs". |
Correlation, Variance and Covariance (Matrices)
var, cov and cor compute the variance of x and the covariance or correlation of x and y if these are vectors. If x and y are matrices then the covariances (or correlations) between the columns of x and the columns of y are computed.
For cov and cor one must either give a matrix or data frame for x or give both x and y.
The inputs must be numeric (as determined by is.numeric: logical values are also allowed for historical compatibility): the "kendall" and "spearman" methods make sense for ordered inputs but xtfrm can be used to find a suitable prior transformation to numbers.
var is just another interface to cov, where na.rm is used to determine the default for use when that is unspecified. If na.rm is TRUE then the complete observations (rows) are used (use = "na.or.complete") to compute the variance. Otherwise, by default use = "everything".
If use is "everything", NAs will propagate conceptually, i.e., a resulting value will be NA whenever one of its contributing observations is NA.
If use is "all.obs", then the presence of missing observations will produce an error. If use is "complete.obs" then missing values are handled by casewise deletion (and if there are no complete cases, that gives an error).
"na.or.complete" is the same unless there are no complete cases, that gives NA. Finally, if use has the value "pairwise.complete.obs" then the correlation or covariance between each pair of variables is computed using all complete pairs of observations on those variables. This can result in covariance or correlation matrices which are not positive semi-definite, as well as NA entries if there are no complete pairs for that pair of variables. For cov and var, "pairwise.complete.obs" only works with the "pearson" method. Note that (the equivalent of) var(double(0), use = *) gives NA for use = "everything" and "na.or.complete", and gives an error in the other cases.
The denominator n - 1n−1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations. These functions return NA when there is only one observation (whereas S-PLUS has been returning NaN).
For cor(), if method is "kendall" or "spearman", Kendall's \tauτ or Spearman's \rhoρ statistic is used to estimate a rank-based measure of association. These are more robust and have been recommended if the data do not necessarily come from a bivariate normal distribution.
For cov(), a non-Pearson method is unusual but available for the sake of completeness. Note that "spearman" basically computes cor(R(x), R(y)) (or cov(., .)) where R(u) := rank(u, na.last = "keep"). In the case of missing values, the ranks are calculated depending on the value of use, either based on complete observations, or based on pairwise completeness with reranking for each pair.
When there are ties, Kendall's \tau_bτ b is computed, as proposed by Kendall (1945).
Scaling a covariance matrix into a correlation one can be achieved in many ways, mathematically most appealing by multiplication with a diagonal matrix from left and right, or more efficiently by using sweep(.., FUN = "/") twice. The cov2cor function is even a bit more efficient, and provided mostly for didactical reasons.
| Name | Type | Description |
|---|---|---|
x | Object | a numeric vector, matrix or data frame. |
y | Object | NULL (default) or a vector, matrix or data frame with compatible dimensions to x. The default is equivalent to y = x (but more efficient). |
use | Object | an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs". |
method | Object | a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated. |
env | Environment | - |
For r <- cor(*, use = "all.obs"), it is now guaranteed that all(abs(r) <= 1).
Function to calculate the Least Common Multiple (LCM)
| Name | Type | Description |
|---|---|---|
a | Object | - |
b | Object | - |
env | Environment | - |
Object, Int32, Double)finds root of specific degree of number.
| Name | Type | Description |
|---|---|---|
x | Object | should be a numeric vector |
n | Int32 | Degree of root. |
eps | Double | Precision with which the calculations are performed. value should be in range (0,1). |
Root of number.
Object)Array)Object, Environment)Object, Double)