1
0
mirror of https://github.com/msberends/AMR.git synced 2025-08-28 11:52:13 +02:00

rename vector2ratio to ratio

This commit is contained in:
2018-07-02 11:14:20 +02:00
parent a1acb2f3ac
commit 3d0d21f322
6 changed files with 20 additions and 20 deletions

View File

@@ -9,7 +9,7 @@ g.test(x, y = NULL, alpha = 0.05, info = TRUE, minimum = 0)
\arguments{
\item{x}{numeric vector or matrix}
\item{y}{expected value of \code{x}. Leave empty to determine automatically. This can also be ratios of \code{x}, e.g. calculated with \code{\link{vector2ratio}}.}
\item{y}{expected value of \code{x}. Leave empty to determine automatically. This can also be ratios of \code{x}, e.g. calculated with \code{\link{ratio}}.}
\item{alpha}{value to test the p value against}
@@ -68,7 +68,7 @@ If there are more than two categories and you want to find out which ones are si
# ratio.
x <- c(772, 1611, 737)
x.expected <- vector2ratio(x, ratio = "1:2:1")
x.expected <- ratio(x, "1:2:1")
x.expected
# 780 1560 780
@@ -88,7 +88,7 @@ g.test(x, x.expected)
# observed 1752 right-billed and 1895 left-billed crossbills.
x <- c(1752, 1895)
x.expected <- vector2ratio(x, ratio = c(1, 1))
x.expected <- ratio(x, ratio = c(1, 1))
x.expected
# 1823.5 1823.5

View File

@@ -1,10 +1,10 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/g.test.R
\name{vector2ratio}
\alias{vector2ratio}
\name{ratio}
\alias{ratio}
\title{Transform vector to ratio}
\usage{
vector2ratio(x, ratio)
ratio(x, ratio)
}
\arguments{
\item{x}{vector of values}
@@ -25,7 +25,7 @@ Transform vector to ratio
# ratio.
x <- c(772, 1611, 737)
x.expected <- vector2ratio(x, ratio = "1:2:1")
x.expected <- ratio(x, "1:2:1")
x.expected
# 780 1560 780
@@ -45,7 +45,7 @@ g.test(x, x.expected)
# observed 1752 right-billed and 1895 left-billed crossbills.
x <- c(1752, 1895)
x.expected <- vector2ratio(x, ratio = c(1, 1))
x.expected <- ratio(x, ratio = c(1, 1))
x.expected
# 1823.5 1823.5