Learn R Programming

wrMisc (version 1.2.3)

ratioAllComb: Calculate all ratios between x and y

Description

ratioAllComb calculates all possible pairwise ratios between all individual calues of x and y.

Usage

ratioAllComb(x, y, maxLim = 10000, silent = FALSE, callFrom = NULL)

Arguments

x

(numeric) vector, numerator for constructing rations

y

(numeric) vector, denominator for constructing rations

maxLim

(integer) allows reducing complexity by drawing for very long x or y

silent

(logical) suppress (less important) messages

callFrom

(character) allow easier tracking of message(s) produced

Value

(numeric) vector with all ratios

Examples

Run this code
# NOT RUN {
set.seed(2014); ra1 <- c(rnorm(9,2,1),runif(8,1,2))
ratioAllComb(ra1[1:9],ra1[10:17])
boxplot(list(norm=ra1[1:9],unif=ra1[10:17],rat=ratioAllComb(ra1[1:9],ra1[10:17])))
# }

Run the code above in your browser using DataLab