id
stringlengths
40
40
repo_name
stringlengths
5
110
path
stringlengths
2
233
content
stringlengths
0
1.03M
size
int32
0
60M
license
stringclasses
15 values
e4ec7c6cdba05222f22aa261ed4986546fabc05d
dselivanov/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
ChiWang/r-source
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
cxxr-devel/cxxr-svn-mirror
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
e4ec7c6cdba05222f22aa261ed4986546fabc05d
DanRuderman/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
12954e98383102a425d5f2cd37eb24226ef30ca1
leppott/ContDataQC
man/data_raw_test2_AW_20140901_20140930.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/data.r \docType{data} \name{data_raw_test2_AW_20140901_20140930} \alias{data_raw_test2_AW_20140901_20140930} \title{data_raw_test2_AW_20140901_20140930} \format{ a data frame with 1440 observations and 18 variables: } \usage{ data_raw_test2_AW_20140901_20140930 } \description{ Test data. } \keyword{datasets}
388
mit
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
jeffreyhorner/R-Judy-Arrays
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
glycerine/bigbird
r-3.0.2/src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
bsd-2-clause
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
mirror/r
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
patperry/r-source
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
24dcb10d393aab301e3fd37383e19d2a1ee2a345
ropenscilabs/gauth
man/token-info.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/token-info.R \name{token-info} \alias{token-info} \alias{token_userinfo} \alias{token_email} \alias{token_tokeninfo} \title{Get info from a token} \usage{ token_userinfo(token) token_email(token) token_tokeninfo(token) } \arguments{ \item{token}{A token with class \link[httr:Token-class]{Token2.0} or an object of httr's class \code{request}, i.e. a token that has been prepared with \code{\link[httr:config]{httr::config()}} and has a \link[httr:Token-class]{Token2.0} in the \code{auth_token} component.} } \value{ A list containing: \itemize{ \item \code{token_userinfo()}: user info \item \code{token_email()}: user's email (obtained from a call to \code{token_userinfo()}) \item \code{token_tokeninfo()}: token info } } \description{ These functions send the \code{token} to Google endpoints that return info about a token or a user. } \details{ It's hard to say exactly what info will be returned by the "userinfo" endpoint targetted by \code{token_userinfo()}. It depends on the token's scopes. OAuth2 tokens obtained via the gargle package include the \verb{https://www.googleapis.com/auth/userinfo.email} scope, which guarantees we can learn the email associated with the token. If the token has the \verb{https://www.googleapis.com/auth/userinfo.profile} scope, there will be even more information available. But for a token with unknown or arbitrary scopes, we can't make any promises about what information will be returned. } \examples{ \dontrun{ # with service account token t <- token_fetch( scopes = "https://www.googleapis.com/auth/drive", path = "path/to/service/account/token/blah-blah-blah.json" ) # or with an OAuth token t <- token_fetch( scopes = "https://www.googleapis.com/auth/drive", email = "janedoe@example.com" ) token_userinfo(t) token_email(t) tokens_tokeninfo(t) } }
1,892
mit
e4ec7c6cdba05222f22aa261ed4986546fabc05d
ijlyttle/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
e4ec7c6cdba05222f22aa261ed4986546fabc05d
antoine-lizee/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
e4ec7c6cdba05222f22aa261ed4986546fabc05d
humburg/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
hxfeng/R-3.1.2
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
865566d1d3ff2c91f6d10718cc290e214439b735
mmaechler/sfsmisc
man/roundfixS.Rd
\name{roundfixS} \alias{roundfixS} \concept{apportionment} \title{Round to Integer Keeping the Sum Fixed} \description{ Given a real numbers \eqn{y_i} with the particular property that \eqn{\sum_i y_i} is integer, find \emph{integer} numbers \eqn{x_i} which are close to \eqn{y_i} (\eqn{\left|x_i - y_i\right| < 1 \forall i}{% |x[i] - y[i]| < 1 for all i}), and have identical \dQuote{marginal} sum, \code{sum(x) == sum(y)}. As I found later, the problem is known as \dQuote{Apportionment Problem} and it is quite an old problem with several solution methods proposed historically, but only in 1982, Balinski and Young proved that there is no method that fulfills three natural desiderata. Note that the (first) three methods currently available here were all (re?)-invented by M.Maechler, without any knowledge of the litterature. At the time of writing, I have not even checked to which (if any) of the historical methods they match. } \usage{ roundfixS(x, method = c("offset-round", "round+fix", "1greedy")) } \arguments{ \item{x}{a numeric vector which \bold{must} sum to an integer} \item{method}{character string specifying the algorithm to be used.} % \item{trace}{logical or integer, enabling algorithm tracing.} } \details{ Without hindsight, it may be surprising that all three methods give identical results (in all situations and simulations considered), notably that the idea of \sQuote{mass shifting} employed in the iterative \code{"1greedy"} algorithm seems equivalent to the much simpler idea used in \code{"offset-round"}. I am pretty sure that these algorithms solve the \eqn{L_p} optimization problem, \eqn{\min_x \left\|y - x\right\|_p}{min_x ||y - x||_p}, typically for all \eqn{p \in [1,\infty]}{p in [1,Inf]} \emph{simultaneously}, but have not bothered to find a formal proof. } \value{ a numeric vector, say \code{r}, of the same length as \code{x}, but with integer values and fulfulling \code{sum(r) == sum(x)}. } \author{Martin Maechler, November 2007} \references{ Michel Balinski and H. Peyton Young (1982) \bold{Fair Representation: Meeting the Ideal of One Man, One Vote}; \url{https://en.wikipedia.org/wiki/Apportionment_paradox} \url{https://www.ams.org/samplings/feature-column/fcarc-apportionii3} } \seealso{\code{\link{round}} etc } \examples{ ## trivial example kk <- c(0,1,7) stopifnot(identical(kk, roundfixS(kk))) # failed at some point x <- c(-1.4, -1, 0.244, 0.493, 1.222, 1.222, 2, 2, 2.2, 2.444, 3.625, 3.95) sum(x) # an integer r <- roundfixS(x) stopifnot(all.equal(sum(r), sum(x))) m <- cbind(x=x, `r2i(x)` = r, resid = x - r, `|res|` = abs(x-r)) rbind(m, c(colSums(m[,1:2]), 0, sum(abs(m[,"|res|"])))) chk <- function(y) { cat("sum(y) =", format(S <- sum(y)),"\n") r2 <- roundfixS(y, method="offset") r2. <- roundfixS(y, method="round") r2_ <- roundfixS(y, method="1g") stopifnot(all.equal(sum(r2 ), S), all.equal(sum(r2.), S), all.equal(sum(r2_), S)) all(r2 == r2. & r2. == r2_) # TRUE if all give the same result } makeIntSum <- function(y) { n <- length(y) y[n] <- ceiling(y[n]) - (sum(y[-n]) \%\% 1) y } set.seed(11) y <- makeIntSum(rnorm(100)) chk(y) ## nastier example: set.seed(7) y <- makeIntSum(rpois(100, 10) + c(runif(75, min= 0, max=.2), runif(25, min=.5, max=.9))) chk(y) \dontrun{ for(i in 1:1000) stopifnot(chk(makeIntSum(rpois(100, 10) + c(runif(75, min= 0, max=.2), runif(25, min=.5, max=.9))))) } } \keyword{arith} \keyword{manip}
3,618
gpl-2.0
466e22f331fdd1a03a121c8a4aa8ff63c1003ba7
limeng12/r-source
src/library/base/man/Extremes.Rd
% File src/library/base/man/Extremes.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2013 R Core Team % Distributed under GPL 2 or later \name{Extremes} \alias{max} \alias{min} \alias{pmax} \alias{pmin} \alias{pmax.int} \alias{pmin.int} \title{Maxima and Minima} \description{ Returns the (parallel) maxima and minima of the input values. } \usage{ max(\dots, na.rm = FALSE) min(\dots, na.rm = FALSE) pmax(\dots, na.rm = FALSE) pmin(\dots, na.rm = FALSE) pmax.int(\dots, na.rm = FALSE) pmin.int(\dots, na.rm = FALSE) } \arguments{ \item{\dots}{numeric or character arguments (see Note).} \item{na.rm}{a logical indicating whether missing values should be removed.} } \details{ \code{max} and \code{min} return the maximum or minimum of \emph{all} the values present in their arguments, as \code{\link{integer}} if all are \code{logical} or \code{integer}, as \code{\link{double}} if all are numeric, and character otherwise. If \code{na.rm} is \code{FALSE} an \code{NA} value in any of the arguments will cause a value of \code{NA} to be returned, otherwise \code{NA} values are ignored. The minimum and maximum of a numeric empty set are \code{+Inf} and \code{-Inf} (in this order!) which ensures \emph{transitivity}, e.g., \code{min(x1, min(x2)) == min(x1, x2)}. For numeric \code{x} \code{max(x) == -Inf} and \code{min(x) == +Inf} whenever \code{length(x) == 0} (after removing missing values if requested). However, \code{pmax} and \code{pmin} return \code{NA} if all the parallel elements are \code{NA} even for \code{na.rm = TRUE}. \code{pmax} and \code{pmin} take one or more vectors (or matrices) as arguments and return a single vector giving the \sQuote{parallel} maxima (or minima) of the vectors. The first element of the result is the maximum (minimum) of the first elements of all the arguments, the second element of the result is the maximum (minimum) of the second elements of all the arguments and so on. Shorter inputs (of non-zero length) are recycled if necessary. Attributes (see \code{\link{attributes}}: such as \code{\link{names}} or \code{\link{dim}}) are copied from the first argument (if applicable). \code{pmax.int} and \code{pmin.int} are faster internal versions only used when all arguments are atomic vectors and there are no classes: they drop all attributes. (Note that all versions fail for raw and complex vectors since these have no ordering.) \code{max} and \code{min} are generic functions: methods can be defined for them individually or via the \code{\link[=S3groupGeneric]{Summary}} group generic. For this to work properly, the arguments \code{\dots} should be unnamed, and dispatch is on the first argument. By definition the min/max of a numeric vector containing an \code{NaN} is \code{NaN}, except that the min/max of any vector containing an \code{NA} is \code{NA} even if it also contains an \code{NaN}. Note that \code{max(NA, Inf) == NA} even though the maximum would be \code{Inf} whatever the missing value actually is. Character versions are sorted lexicographically, and this depends on the collating sequence of the locale in use: the help for \sQuote{\link{Comparison}} gives details. The max/min of an empty character vector is defined to be character \code{NA}. (One could argue that as \code{""} is the smallest character element, the maximum should be \code{""}, but there is no obvious candidate for the minimum.) } \value{ For \code{min} or \code{max}, a length-one vector. For \code{pmin} or \code{pmax}, a vector of length the longest of the input vectors, or length zero if one of the inputs had zero length. The type of the result will be that of the highest of the inputs in the hierarchy integer < double < character. For \code{min} and \code{max} if there are only numeric inputs and all are empty (after possible removal of \code{NA}s), the result is double (\code{Inf} or \code{-Inf}). } \section{S4 methods}{ \code{max} and \code{min} are part of the S4 \code{\link[=S4groupGeneric]{Summary}} group generic. Methods for them must use the signature \code{x, \dots, na.rm}. } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth & Brooks/Cole. } \note{ \sQuote{Numeric} arguments are vectors of type integer and numeric, and logical (coerced to integer). For historical reasons, \code{NULL} is accepted as equivalent to \code{integer(0)}.% PR#1283 \code{pmax} and \code{pmin} will also work on classed objects with appropriate methods for comparison, \code{is.na} and \code{rep} (if recycling of arguments is needed). } \seealso{ \code{\link{range}} (\emph{both} min and max) and \code{\link{which.min}} (\code{which.max}) for the \emph{arg min}, i.e., the location where an extreme value occurs. \sQuote{\link{plotmath}} for the use of \code{min} in plot annotation. } \examples{ require(stats); require(graphics) min(5:1, pi) #-> one number pmin(5:1, pi) #-> 5 numbers x <- sort(rnorm(100)); cH <- 1.35 pmin(cH, quantile(x)) # no names pmin(quantile(x), cH) # has names plot(x, pmin(cH, pmax(-cH, x)), type = "b", main = "Huber's function") cut01 <- function(x) pmax(pmin(x, 1), 0) curve( x^2 - 1/4, -1.4, 1.5, col = 2) curve(cut01(x^2 - 1/4), col = "blue", add = TRUE, n = 500) ## pmax(), pmin() preserve attributes of *first* argument D <- diag(x = (3:1)/4) ; n0 <- numeric() stopifnot(identical(D, cut01(D) ), identical(n0, cut01(n0)), identical(n0, cut01(NULL)), identical(n0, pmax(3:1, n0, 2)), identical(n0, pmax(n0, 4))) } \keyword{univar} \keyword{arith}
5,740
gpl-2.0
24dcb10d393aab301e3fd37383e19d2a1ee2a345
craigcitro/gauth
man/token-info.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/token-info.R \name{token-info} \alias{token-info} \alias{token_userinfo} \alias{token_email} \alias{token_tokeninfo} \title{Get info from a token} \usage{ token_userinfo(token) token_email(token) token_tokeninfo(token) } \arguments{ \item{token}{A token with class \link[httr:Token-class]{Token2.0} or an object of httr's class \code{request}, i.e. a token that has been prepared with \code{\link[httr:config]{httr::config()}} and has a \link[httr:Token-class]{Token2.0} in the \code{auth_token} component.} } \value{ A list containing: \itemize{ \item \code{token_userinfo()}: user info \item \code{token_email()}: user's email (obtained from a call to \code{token_userinfo()}) \item \code{token_tokeninfo()}: token info } } \description{ These functions send the \code{token} to Google endpoints that return info about a token or a user. } \details{ It's hard to say exactly what info will be returned by the "userinfo" endpoint targetted by \code{token_userinfo()}. It depends on the token's scopes. OAuth2 tokens obtained via the gargle package include the \verb{https://www.googleapis.com/auth/userinfo.email} scope, which guarantees we can learn the email associated with the token. If the token has the \verb{https://www.googleapis.com/auth/userinfo.profile} scope, there will be even more information available. But for a token with unknown or arbitrary scopes, we can't make any promises about what information will be returned. } \examples{ \dontrun{ # with service account token t <- token_fetch( scopes = "https://www.googleapis.com/auth/drive", path = "path/to/service/account/token/blah-blah-blah.json" ) # or with an OAuth token t <- token_fetch( scopes = "https://www.googleapis.com/auth/drive", email = "janedoe@example.com" ) token_userinfo(t) token_email(t) tokens_tokeninfo(t) } }
1,892
mit
0993ae5857e6010923aa348847a553e770b6b75a
cdiener/kcone-paper
scraped_concs.Rd
null
7,518
mit
e4ec7c6cdba05222f22aa261ed4986546fabc05d
zhmz90/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
e4ec7c6cdba05222f22aa261ed4986546fabc05d
GShotwell/readr
man/read_file.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/input.R \name{read_file} \alias{read_file} \title{Read a file into a string.} \usage{ read_file(file) } \arguments{ \item{file}{Either a path to a file, a connection, or literal data (either a single string or a raw vector). Files ending in \code{.gz}, \code{.bz2}, \code{.xz}, or \code{.zip} will be automatically uncompressed. Files starting with \code{http://}, \code{https://}, \code{ftp://}, or \code{ftps://} will be automatically downloaded. Literal data is most useful for examples and tests. It must contain at least one new line to be recognised as data (instead of a path).} } \description{ Read a file into a string. } \examples{ read_file(file.path(R.home(), "COPYING")) }
796
gpl-2.0
d25de06bb87edb89836afbd4944e75a8e918bba1
fosterlab/PrInCE
man/make_initial_conditions.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/make_initial_conditions.R \name{make_initial_conditions} \alias{make_initial_conditions} \title{Make initial conditions for curve fitting with a mixture of Gaussians} \usage{ make_initial_conditions( chromatogram, n_gaussians, method = c("guess", "random"), sigma_default = 2, sigma_noise = 0.5, mu_noise = 1.5, A_noise = 0.5 ) } \arguments{ \item{chromatogram}{a numeric vector corresponding to the chromatogram trace} \item{n_gaussians}{the number of Gaussians being fit} \item{method}{one of "guess" or "random", discussed above} \item{sigma_default}{the default mean initial value of sigma} \item{sigma_noise}{the amount of random noise to add or subtract from the default mean initial value of sigma} \item{mu_noise}{the amount of random noise to add or subtract from the Gaussian centers in "guess" mode} \item{A_noise}{the amount of random noise to add or subtract from the Gaussian heights in "guess" mode} } \value{ a list of three numeric vectors (A, mu, and sigma), each having a length equal to the maximum number of Gaussians to fit } \description{ Construct a set of initial conditions for curve fitting using nonlinear least squares using a mixture of Gaussians. The "guess" method ports code from the Matlab release of PrInCE. This method finds local maxima within the chromatogram, orders them by their separation (in number of fractions) from the previous local maxima, and uses the positions and heights of these local maxima (+/- some random noise) as initial conditions for Gaussian curve-fitting. The "random" method simply picks random values within the fraction and intensity intervals as starting points for Gaussian curve-fitting. The initial value of sigma is set by default to a random number within +/- 0.5 of two for both modes; this is based on our manual inspection of a large number of chromatograms. } \examples{ data(scott) chrom <- clean_profile(scott[16, ]) set.seed(0) start <- make_initial_conditions(chrom, n_gaussians = 2, method = "guess") }
2,093
mit
25f8482e2595e4a84d0dec460b55d7944a91bc69
johngarvin/R-2.1.1rcc
src/library/stats/man/dist.Rd
\name{dist} \alias{dist} \alias{print.dist} \alias{format.dist} \alias{as.matrix.dist} \alias{as.dist} \alias{as.dist.default} \title{Distance Matrix Computation} \description{ This function computes and returns the distance matrix computed by using the specified distance measure to compute the distances between the rows of a data matrix. } \usage{ dist(x, method = "euclidean", diag = FALSE, upper = FALSE, p = 2) as.dist(m, diag = FALSE, upper = FALSE) \method{as.dist}{default}(m, diag = FALSE, upper = FALSE) \method{print}{dist}(x, diag = NULL, upper = NULL, digits = getOption("digits"), justify = "none", right = TRUE, \dots) \method{as.matrix}{dist}(x) } \arguments{ \item{x}{a numeric matrix, data frame or \code{"dist"} object.} \item{method}{the distance measure to be used. This must be one of \code{"euclidean"}, \code{"maximum"}, \code{"manhattan"}, \code{"canberra"}, \code{"binary"} or \code{"minkowski"}. Any unambiguous substring can be given.} \item{diag}{logical value indicating whether the diagonal of the distance matrix should be printed by \code{print.dist}.} \item{upper}{logical value indicating whether the upper triangle of the distance matrix should be printed by \code{print.dist}.} \item{p}{The power of the Minkowski distance.} \item{m}{An object with distance information to be converted to a \code{"dist"} object. For the default method, a \code{"dist"} object, or a matrix (of distances) or an object which can be coerced to such a matrix using \code{\link{as.matrix}()}. (Only the lower triangle of the matrix is used, the rest is ignored).} \item{digits, justify}{passed to \code{\link{format}} inside of \code{print()}.} \item{right, \dots}{further arguments, passed to the (next) \code{print} method.} } \details{ Available distance measures are (written for two vectors \eqn{x} and \eqn{y}): \describe{ \item{\code{euclidean}:}{Usual square distance between the two vectors (2 norm).} \item{\code{maximum}:}{Maximum distance between two components of \eqn{x} and \eqn{y} (supremum norm)} \item{\code{manhattan}:}{Absolute distance between the two vectors (1 norm).} \item{\code{canberra}:}{\eqn{\sum_i |x_i - y_i| / |x_i + y_i|}{% sum(|x_i - y_i| / |x_i + y_i|)}. Terms with zero numerator and denominator are omitted from the sum and treated as if the values were missing. } \item{\code{binary}:}{(aka \emph{asymmetric binary}): The vectors are regarded as binary bits, so non-zero elements are \sQuote{on} and zero elements are \sQuote{off}. The distance is the \emph{proportion} of bits in which only one is on amongst those in which at least one is on.} \item{\code{minkowski}:}{The \eqn{p} norm, the \eqn{p}th root of the sum of the \eqn{p}th powers of the differences of the components.} } Missing values are allowed, and are excluded from all computations involving the rows within which they occur. Further, when \code{Inf} values are involved, all pairs of values are excluded when their contribution to the distance gave \code{NaN} or \code{NA}.\cr If some columns are excluded in calculating a Euclidean, Manhattan, Canberra or Minkowski distance, the sum is scaled up proportionally to the number of columns used. If all pairs are excluded when calculating a particular distance, the value is \code{NA}. The \code{"dist"} method of \code{as.matrix()} and \code{as.dist()} can be used for conversion between objects of class \code{"dist"} and conventional distance matrices. \code{as.dist()} is a generic function. Its default method handles objects inheriting from class \code{"dist"}, or coercible to matrices using \code{\link{as.matrix}()}. Support for classes representing distances (also known as dissimilarities) can be added by providing an \code{\link{as.matrix}()} or, more directly, an \code{as.dist} method for such a class. } \value{ \code{dist} returns an object of class \code{"dist"}. The lower triangle of the distance matrix stored by columns in a vector, say \code{do}. If \code{n} is the number of observations, i.e., \code{n <- attr(do, "Size")}, then for \eqn{i < j <= n}, the dissimilarity between (row) i and j is \code{do[n*(i-1) - i*(i-1)/2 + j-i]}. The length of the vector is \eqn{n*(n-1)/2}, i.e., of order \eqn{n^2}. The object has the following attributes (besides \code{"class"} equal to \code{"dist"}): \item{Size}{integer, the number of observations in the dataset.} \item{Labels}{optionally, contains the labels, if any, of the observations of the dataset.} \item{Diag, Upper}{logicals corresponding to the arguments \code{diag} and \code{upper} above, specifying how the object should be printed.} \item{call}{optionally, the \code{\link{call}} used to create the object.} \item{method}{optionally, the distance method used; resulting from \code{\link{dist}()}, the (\code{\link{match.arg}()}ed) \code{method} argument.} } \references{ Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) \emph{The New S Language}. Wadsworth \& Brooks/Cole. Mardia, K. V., Kent, J. T. and Bibby, J. M. (1979) \emph{Multivariate Analysis.} Academic Press. Borg, I. and Groenen, P. (1997) \emph{Modern Multidimensional Scaling. Theory and Applications.} Springer. } \seealso{ \code{\link[cluster]{daisy}} in the \pkg{cluster} package with more possibilities in the case of \emph{mixed} (continuous / categorical) variables. \code{\link{hclust}}. } \examples{ x <- matrix(rnorm(100), nrow=5) dist(x) dist(x, diag = TRUE) dist(x, upper = TRUE) m <- as.matrix(dist(x)) d <- as.dist(m) stopifnot(d == dist(x)) ## example of binary and canberra distances. x <- c(0, 0, 1, 1, 1, 1) y <- c(1, 0, 1, 1, 0, 1) dist(rbind(x,y), method="binary") ## answer 0.4 = 2/5 dist(rbind(x,y), method="canberra") ## answer 2 * (6/5) ## Examples involving "Inf" : ## 1) x[6] <- Inf (m2 <- rbind(x,y)) dist(m2, method="binary")# warning, answer 0.5 = 2/4 ## These all give "Inf": stopifnot(Inf == dist(m2, method= "euclidean"), Inf == dist(m2, method= "maximum"), Inf == dist(m2, method= "manhattan")) ## "Inf" is same as very large number: x1 <- x; x1[6] <- 1e100 stopifnot(dist(cbind(x ,y), method="canberra") == print(dist(cbind(x1,y), method="canberra"))) ## 2) y[6] <- Inf #-> 6-th pair is excluded dist(rbind(x,y), method="binary") # warning; 0.5 dist(rbind(x,y), method="canberra") # 3 dist(rbind(x,y), method="maximum") # 1 dist(rbind(x,y), method="manhattan")# 2.4 } \keyword{multivariate} \keyword{cluster}
6,699
gpl-2.0
0bffb676e4cf1d03658cc1dfc2de8c22b795e8e6
BIMIB-DISCo/TRONCO
man/pathway.visualization.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/visualization.R \name{pathway.visualization} \alias{pathway.visualization} \title{pathway.visualization} \usage{ pathway.visualization( x, title = paste("Pathways:", paste(names(pathways), collapse = ", ", sep = "")), file = NA, pathways.color = "Set2", aggregate.pathways, pathways, ... ) } \arguments{ \item{x}{A TRONCO complian dataset} \item{title}{Plot title} \item{file}{To generate a PDF a filename have to be given} \item{pathways.color}{A RColorBrewer color palette} \item{aggregate.pathways}{Boolean parameter} \item{pathways}{Pathways} \item{...}{Additional parameters} } \value{ plot information } \description{ Visualise pathways informations }
756
gpl-3.0
e8a4a3d319866f6b0475c67b9d87e08110a57cc0
radfordneal/pqR
src/library/graphics/man/units.Rd
% File src/library/graphics/man/units.Rd % Part of the R package, http://www.R-project.org % Copyright 1995-2007 R Core Team % Distributed under GPL 2 or later \name{units} \alias{xinch} \alias{yinch} \alias{xyinch} \title{Graphical Units} \description{ \code{xinch} and \code{yinch} convert the specified number of inches given as their arguments into the correct units for plotting with graphics functions. Usually, this only makes sense when normal coordinates are used, i.e., \emph{no} \code{log} scale (see the \code{log} argument to \code{\link{par}}). \code{xyinch} does the same for a pair of numbers \code{xy}, simultaneously. } \usage{ xinch(x = 1, warn.log = TRUE) yinch(y = 1, warn.log = TRUE) xyinch(xy = 1, warn.log = TRUE) } \arguments{ \item{x,y}{numeric vector} \item{xy}{numeric of length 1 or 2.} \item{warn.log}{logical; if \code{TRUE}, a warning is printed in case of active log scale.} } \examples{ all(c(xinch(),yinch()) == xyinch()) # TRUE xyinch() xyinch #- to see that is really delta{"usr"} / "pin" ## plot labels offset 0.12 inches to the right ## of plotted symbols in a plot with(mtcars, { plot(mpg, disp, pch=19, main= "Motor Trend Cars") text(mpg + xinch(0.12), disp, row.names(mtcars), adj = 0, cex = .7, col = 'blue') }) } \keyword{dplot}
1,324
gpl-2.0
39096a36d24c8a1cc4d89a0bd3276163309c0a9d
cran/Rdrools
man/getDrlForRowwiseRules.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Rdrools.R \name{getDrlForRowwiseRules} \alias{getDrlForRowwiseRules} \title{DRL format for rules to be applied row-wise} \usage{ getDrlForRowwiseRules(dataset, rules, ruleNum, input.columns, output.columns) } \arguments{ \item{dataset}{rules defined in a csv file} \item{rules}{the rules defined in csv format} \item{outputDf}{the output data frame returned by the executeRulesOnDataset function} } \value{ drl format of rules for row wise rules } \description{ : This function is used to get the drl format of rules for row wise rules } \keyword{internal}
639
lgpl-3.0
7eaae4efc7ff1eba39270a249992f7135e891928
lagelab/Genoppi
man/line_unity.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/misc.R \name{line_unity} \alias{line_unity} \title{line_unity} \usage{ line_unity() } \description{ plots a unity line }
199
mit
e9e28a75a63b4bb58991ed93c6b764eca1340f36
msalibian/FRBmodelselection
man/my.rlm.Rd
\name{my.rlm} \alias{my.rlm} %- Also NEED an '\alias' for EACH other topic documented here. \title{MM-regression estimators. %% ~~function to do ... ~~ } \description{This function computes MM-regression estimators. %% ~~ A concise (1-5 lines) description of what the function does. ~~ } \usage{ my.rlm(x, y, control = rlm.control()) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{x}{Design matrix, each vector of covariates in a row. %% ~~Describe \code{x} here~~ } \item{y}{Vector of response variables. %% ~~Describe \code{y} here~~ } \item{control}{List of control options as returned by \code{\link{rlm.control}}. %% ~~Describe \code{control} here~~ } } \details{This function computes an MM-regression estimator. %% ~~ If necessary, more details than the description above ~~ } \value{The function returns a list with the following components: \item{coef }{Vector of MM-regression estimates} \item{scale }{Estimated residual scale} \item{coef.s }{Vector of S-regression estimates} %% ~Describe the value returned %% If it is a LIST, use %% \item{comp1 }{Description of 'comp1'} %% \item{comp2 }{Description of 'comp2'} %% ... } \references{ %% ~put references to the literature/web site here ~ } \author{Matias Salibian-Barrera %% ~~who you are~~ } \note{ %% ~~further notes~~ } %% ~Make other sections like Warning with \section{Warning }{....} ~ \seealso{\code{\link{rlm.control}} %% ~~objects to See Also as \code{\link{help}}, ~~~ } \examples{ ##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (x, y, control = rlm.control()) { x <- as.matrix(x) M <- control$M Nres <- control$Nres seed <- control$seed fixed <- control$fixed tuning.chi <- control$tuning.chi tuning.psi <- control$tuning.psi max.it <- control$max.it groups <- control$groups n.group <- control$n.group k.fast.s <- control$k.fast.s n <- nrow(x) p <- ncol(x) a <- .C("R_S_rlm", as.double(x), as.double(y), as.integer(n), as.integer(p), as.integer(Nres), as.integer(max.it), s = as.double(0), beta.s = as.double(rep(0, p)), beta.m = as.double(rep(0, p)), as.integer(1), as.integer(seed), as.double(tuning.chi), as.double(tuning.psi), as.integer(groups), as.integer(n.group), as.integer(k.fast.s)) return(list(coef = a$beta.m, scale = a$s, coef.s = a$beta.s)) } } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS") \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
2,742
gpl-3.0
64192ada3c100f1ea51bd36fd09bef106e2e167d
cran/Rclusterpp
man/Rclusterpp.package.skeleton.Rd
\name{Rclusterpp.package.skeleton} \alias{Rclusterpp.package.skeleton} \title{ Create a skeleton for a new package that intends to use Rclusterpp } \description{ \code{Rclusterpp.package.skeleton} automates the creation of a new source package that intends to use features of Rclusterpp. It is based on the \link[RcppEigen]{RcppEigen.package.skeleton} and executes \link[utils]{package.skeleton} internally. } \usage{ Rclusterpp.package.skeleton(name = "anRpackage", list = character(), environment = .GlobalEnv, path = ".", force = FALSE, namespace = TRUE, code_files = character(), example_code = TRUE) } \arguments{ \item{name}{See \link[utils]{package.skeleton}} \item{list}{See \link[utils]{package.skeleton}} \item{environment}{See \link[utils]{package.skeleton}} \item{path}{See \link[utils]{package.skeleton}} \item{force}{See \link[utils]{package.skeleton}} \item{namespace}{See \link[utils]{package.skeleton}} \item{code_files}{See \link[utils]{package.skeleton}} \item{example_code}{If TRUE, example C++ code using Rclusterpp is added to the package} } \details{ In addition to \link[utils]{package.skeleton} : The \samp{DESCRIPTION} file gains a Depends line requesting that the package depends on Rcpp and Rclusterpp and a LinkingTo line so that the package finds Rcpp and Rclusterpp header files. The \samp{NAMESPACE}, if any, gains a \code{useDynLib} directive. The \samp{src} directory is created if it does not exists and a \samp{Makevars} file is added setting the environment variable \samp{PKG_LIBS} to accomodate the necessary flags to link with the Rcpp library. If the \code{example_code} argument is set to \code{TRUE}, example files \samp{rclusterpp_hello_world.h} and \samp{rclusterpp_hello_world.cpp} are also created in the \samp{src}. An R file \samp{rclusterpp_hello_world.R} is expanded in the \samp{R} directory, the \code{rclusterpp_hello_world} function defined in this files makes use of the C++ function \samp{rclusterpp_hello_world} defined in the C++ file. These files are given as an example and should eventually by removed from the generated package. } \value{ Nothing, used for its side effects } \seealso{ \link[RcppEigen]{RcppEigen.package.skeleton} \link[utils]{package.skeleton} } \references{ Read the \emph{Writing R Extensions} manual for more details. Once you have created a \emph{source} package you need to install it: see the \emph{R Installation and Administration} manual, \code{\link{INSTALL}} and \code{\link{install.packages}}. } \examples{ \dontrun{ Rclusterpp.package.skeleton( "foobar" ) } } \keyword{ programming }
2,630
mit
32f0d31ad1aae2c0997ab57c55eed07c1246560a
rforge/pastecs
pkg/man/regul.screen.Rd
\name{regul.screen} \alias{regul.screen} \encoding{latin1} \title{ Test various regulation parameters } \description{ Seek for the best combination of the number of observation, the interval between two successive observation and the position of the first observation in the regulated time series to match as much observations of the initial series as possible } \usage{ regul.screen(x, weight=NULL, xmin=min(x), frequency=NULL, deltat=(max(x, na.rm = TRUE) - min(x, na.rm = TRUE))/(length(x) - 1), tol=deltat/5, tol.type="both") } \arguments{ \item{x}{ a vector with times corresponding to the observations in the irregular initial time series } \item{weight}{ a vector of the same length as \code{x}, with the weight to give to each observation. A value of 0 indicates to ignore an observation. A value of 1 gives a normal weight to an observation. A higher value gives more importance to the corresponding observation. You can increase weight of observations around major peaks and pits, to make sure they are not lost in the regulated time series. If \code{weight=NULL} (by default), then a weight of 1 is used for all observations } \item{xmin}{ a vector with all time values for the first observation in the regulated time series to be tested } \item{frequency}{ a vector with all the frequencies to be screened } \item{deltat}{ a vector with all time intervals to screen. \code{deltat} is the inverse of \code{frequency}. Only one of these two arguments is required. If both are provided, \code{frequency} supersedes \code{deltat} } \item{tol}{ it is possible to tolerate some differences in the time between two matching observations (in the original irregular series and in the regulated series). If \code{tol=0} both values must be strictly identical; a higher value allows some fuzzy matching. \code{tol} must be a round fraction of \code{deltat} and cannot be higher than it, otherwise, it is adjusted to the closest acceptable value. By default, \code{tol=deltat/5} } \item{tol.type}{ the type of window to use for the time-tolerance: \code{"left"}, \code{"right"}, \code{"both"} (by default) or \code{"none"}. If \code{tol.type="left"}, corresponding \code{x} values are seeked in a window ]xregul-tol, xregul]. If \code{tol.type="right"}, they are seeked in the window [xregul, xregul+tol[. If \code{tol.type="both"}, then they are seeked in the window ]xregul-tol, xregul+tol]. If several observations are in this window, the closest one is used. Finally, if \code{tol.type="none"}, then \emph{all} observations in the regulated time series are interpolated (even if exactly matching observations exist!) } } \details{ Whatever the efficiency of the interpolation procedure used to regulate an irregular time series, a matching, non-interpolated observation is always better than an interpolated one! With very irregular time series, it is often difficult to decide which is the better regular time-scale in order to interpolate as less observations as possible. \code{regul.screen()} tests various combinations of number of observation, interval between two observations and position of the first observation and allows to choose the combination that best matches the original irregular time series. To choose also an optimal value for \code{tol}, use \code{regul.adj()} concurrently. } \value{ A list containing: \item{tol}{ a vector with the adjusted values of \code{tol} for the various values of \code{deltat} } \item{n}{ a table indicating the maximum value of \code{n} for all combinations of \code{deltat} and \code{xmin} to avoid any extrapolation } \item{nbr.match}{ a table indicating the number of matching observations (in the tolerance window) for all combinations of \code{deltat} and \code{xmin} } \item{nbr.exact.match}{ a table indicating the number of exactly matching observations (with a tolerance window equal to zero) for all combinations of \code{deltat} and \code{xmin} } } \author{ Philippe Grosjean (\email{phgrosjean@sciviews.org}), Frédéric Ibanez (\email{ibanez@obs-vlfr.fr}) } \seealso{ \code{\link{regul.adj}}, \code{\link{regul}} } \examples{ data(releve) # This series is very irregular, and it is difficult # to choose the best regular time-scale releve$Day length(releve$Day) intervals <- releve$Day[2:61]-releve$Day[1:60] intervals range(intervals) mean(intervals) # A combination of xmin=1, deltat=22 and n=61 seems correct # But is it the best one? regul.screen(releve$Day, xmin=0:11, deltat=16:27, tol=1.05) # Now we can tell that xmin=9, deltat=21, n=63, with tol=1.05 # is a much better choice! } \keyword{ ts } \keyword{ chron }
4,686
gpl-2.0
e1db40f526b345f1306c522dfc5e5703e013acb6
terrytangyuan/reticulate
man/py_set_seed.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/seed.R \name{py_set_seed} \alias{py_set_seed} \title{Set Python and NumPy random seeds} \usage{ py_set_seed(seed, disable_hash_randomization = TRUE) } \arguments{ \item{seed}{A single value, interpreted as an integer} \item{disable_hash_randomization}{Disable hash randomization, which is another common source of variable results. See \url{https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONHASHSEED}} } \description{ Set various random seeds required to ensure reproducible results. The provided \code{seed} value will establish a new random seed for Python and NumPy, and will also (by default) disable hash randomization. } \details{ This function does not set the R random seed, for that you should call \code{\link[=set.seed]{set.seed()}}. }
836
apache-2.0
e1db40f526b345f1306c522dfc5e5703e013acb6
rstudio/reticulate
man/py_set_seed.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/seed.R \name{py_set_seed} \alias{py_set_seed} \title{Set Python and NumPy random seeds} \usage{ py_set_seed(seed, disable_hash_randomization = TRUE) } \arguments{ \item{seed}{A single value, interpreted as an integer} \item{disable_hash_randomization}{Disable hash randomization, which is another common source of variable results. See \url{https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONHASHSEED}} } \description{ Set various random seeds required to ensure reproducible results. The provided \code{seed} value will establish a new random seed for Python and NumPy, and will also (by default) disable hash randomization. } \details{ This function does not set the R random seed, for that you should call \code{\link[=set.seed]{set.seed()}}. }
836
apache-2.0
9e268be469b184e23e5ab46bc6781ffa764fdc09
PoonLab/Kaphi
pkg/man/parse.labels.Rd
\name{parse.labels} \alias{parse.labels} \title{ Parse labels for \code{init.workspace} } \description{ \code{parse.labels} compares a list of tip labels from a phylogenetic tree to a regular expression to parse labels to be used by \code{init.workspace}. } \usage{ parse.labels(labels, regex) } \arguments{ \item{labels}{ A character vector containing the tip labels of obs.tree. } \item{regex}{ A character string containing a \link{regular expression}. } } \details{} \value{ A character vector containing parsed labels. } \references{} \author{ Art Poon and Mathias Renaud } \note{ Perl-compatible regular expressions should be used. } \seealso{ \code{\link{init.workspace}} for use of output. } \examples{ ## Set labels: labels <- c('1_A', '2_B', '3_A', '4_') ## Set regular expression: regex <- '_([A-Z]*)$' result <- parse.labels(labels, regex) } \keyword{labels} \keyword{workspace}
976
agpl-3.0
b0325edf06ac5ee6f9e6b2408f62268ab2d7d078
gavinsimpson/analogue
man/plot.roc.Rd
\name{plot.roc} \alias{plot.roc} \concept{ROC} \concept{likelihood ratios} %- Also NEED an '\alias' for EACH other topic documented here. \title{Plot ROC curves and associated diagnostics} \description{ Produces up to four plots (selectable by \code{"which"}) from the results of a call to \code{\link{roc}}, including the ROC curve itself. } \usage{ \method{plot}{roc}(x, which = c(1:3,5), group = "Combined", prior = NULL, show.stats = TRUE, abline.col = "grey", abline.lty = "dashed", inGroup.col = "red", outGroup.col = "blue", lty = "solid", caption = c("ROC curve", "Dissimilarity profiles", "TPF - FPF vs Dissimilarity", "Likelihood ratios"), legend = "topright", ask = prod(par("mfcol")) < length(which) && dev.interactive(), ...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{x}{an object of class \code{"roc"}.} \item{which}{numeric vector; which aspects of \code{"roc"} object to plot if a subset of the plots is required, specify a subset of the numbers \code{1:5}.} \item{group}{character vector of length 1 giving the name of the group to plot.} \item{prior}{numeric vector of length 2 (e.g. \code{c(0.5, 0.5)}) specifiying the prior probabilities of analogue and no-analogue. Used to generate posterior probability of analogue using Bayes factors in plot 5 (\code{which = 5}).} \item{show.stats}{logical; should concise summary statistics of the ROC analysis be displayed on the plot?} \item{abline.col}{character string or numeric value; the colour used to draw vertical lines at the optimal dissimilarity on the plots.} \item{abline.lty}{Line type for indicator of optimal ROC dissimilarity threshold. See \code{\link{par}} for the allowed line types.} \item{inGroup.col}{character string or numeric value; the colour used to draw the density curve for the dissimilarities between sites in the same group.} \item{outGroup.col}{character string or numeric value; the colour used to draw the density curve for the dissimilarities between sites not in the same group.} \item{lty}{vector of at most length 2 (elements past the second in longer vectors are ignored) line types. The first element of \code{lty} will be used where a single line is drawn on a plot. Where two lines are drawn (for analogue and non-analogue cases), the first element pertains to the analogue group and the second element to the non-analogue group. See \code{\link{par}} for the allowed line types.} \item{caption}{vector of character strings, containing the captions to appear above each plot.} \item{legend}{character; position of legends drawn on plots. See Details section in \code{\link{legend}} for keywords that can be specified.} \item{ask}{logical; if \code{TRUE}, the user is \emph{ask}ed before each plot, see \code{par(ask=.)}.} \item{\dots}{graphical arguments passed to other graphics functions.} } \details{ This plotting function is modelled closely on \code{\link{plot.lm}} and many of the conventions and defaults for that function are replicated here. First, some definitions: \describe{ \item{\strong{TPF}}{ True Positive Fraction, also known as \emph{sensitivity}.} \item{\strong{TNF}}{ True Negative Fraction, also known as \emph{specificity}.} \item{\strong{FPF}}{ False Positive Fraction; the complement of TNF, calculated as 1 - TNF. This is often referred to a 1 - specificity. A false positive is also known as a type I error.} \item{\strong{FNF}}{ False Negative Fraction; the complement of TPF, calculated as 1 - TPF. A false negative is also known as a type II error. } \item{\strong{AUC}}{ The Area Under the ROC Curve.} } The "ROC curve" plot (\code{which = 1},) draws the ROC curve itself as a plot of the False Positive Fraction against the True Positive Fraction. A diagonal 1:1 line represents no ability for the dissimilarity coefficient to differentiate between groups. The AUC statistic may also be displayed (see argument \code{"show.stats"} above). The "Dissimilarity profile" plot (\code{which = 2}), draws the density functions of the dissimilarity values (\emph{d}) for the correctly assigned samples and the incorrectly assigned samples. A dissimilarity coefficient that is able to well distinguish the sample groupings will have density functions for the correctly and incorrectly assigned samples that have little overlap. Conversely, a poorly discriminating dissimilarity coefficient will have density profiles for the two assignments that overlap considerably. The point where the two curves cross is the optimal dissimilarity or critical value, \emph{d'}. This represents the point where the difference between TPF and FPF is maximal. The value of \emph{d} at the point where the difference between TPF and FPF is maximal will not neccesarily be the same as the value of \emph{d'} where the density profiles cross. This is because the ROC curve has been estimated at discrete points \emph{d}, which may not include excatly the optimal \emph{d'}, but which should be close to this value if the ROC curve is not sampled on too coarse an interval. The "TPF - FPF vs Dissimilarity" plot, draws the difference between the ROC curve and the 1:1 line. The point where the ROC curve is farthest from the 1:1 line is the point at which the ROC curve has maximal slope. This is the optimal value for \emph{d}, as discussed above. The "Likelihood ratios" plot, draws two definitions of the slope of the ROC curve as the likelihood functions LR(+), and LR(-). LR(+), is the likelihood ratio of a positive test result, that the value of \emph{d} assigns the sample to the group it belongs to. LR(-) is the likelihood ratio of a negative test result, that the value of \emph{d} assigns the sample to the wrong group. LR(+) is defined as \eqn{LR(+) = TPF / FPF} (or sensitivity / (1 - specificity)), and LR(-) is defined as \eqn{LR(-) = FPF / TNF} (or (1 - sensitivity) / specificity), in Henderson (1993). The \dQuote{probability of analogue} plot, draws the posterior probability of analogue given a dissimilarity. This is the LR(+) likelihood ratio values multiplied by the prior odds of analogue, for given values of the dissimilarity, and is then converted to a probability. } \value{ One or more plots, drawn on the current device. } \references{ Brown, C.D., and Davis, H.T. (2006) Receiver operating characteristics curves and related decision measures: A tutorial. \emph{Chemometrics and Intelligent Laboratory Systems} \bold{80}, 24--38. Gavin, D.G., Oswald, W.W., Wahl, E.R. and Williams, J.W. (2003) A statistical approach to evaluating distance metrics and analog assignments for pollen records. \emph{Quaternary Research} \strong{60}, 356--367. Henderson, A.R. (1993) Assessing test accuracy and its clinical consequences: a primer for receiver operating characteristic curve analysis. \emph{Annals of Clinical Biochemistry} \strong{30}, 834--846. } \author{Gavin L. Simpson. Code borrows heavily from \code{\link{plot.lm}}.} \seealso{\code{\link{roc}} for a complete example} % \examples{ % ## continue the example from roc() % example(roc) % ## draw the ROC curve % plot(swap.roc, 1) % ## draw the four default diagnostic plots % opar <- par(mfrow = c(2,2)) % plot(swap.roc) % par(opar) % } \keyword{hplot} \keyword{methods}
7,629
gpl-2.0
b0325edf06ac5ee6f9e6b2408f62268ab2d7d078
jarioksa/analogue
man/plot.roc.Rd
\name{plot.roc} \alias{plot.roc} \concept{ROC} \concept{likelihood ratios} %- Also NEED an '\alias' for EACH other topic documented here. \title{Plot ROC curves and associated diagnostics} \description{ Produces up to four plots (selectable by \code{"which"}) from the results of a call to \code{\link{roc}}, including the ROC curve itself. } \usage{ \method{plot}{roc}(x, which = c(1:3,5), group = "Combined", prior = NULL, show.stats = TRUE, abline.col = "grey", abline.lty = "dashed", inGroup.col = "red", outGroup.col = "blue", lty = "solid", caption = c("ROC curve", "Dissimilarity profiles", "TPF - FPF vs Dissimilarity", "Likelihood ratios"), legend = "topright", ask = prod(par("mfcol")) < length(which) && dev.interactive(), ...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{x}{an object of class \code{"roc"}.} \item{which}{numeric vector; which aspects of \code{"roc"} object to plot if a subset of the plots is required, specify a subset of the numbers \code{1:5}.} \item{group}{character vector of length 1 giving the name of the group to plot.} \item{prior}{numeric vector of length 2 (e.g. \code{c(0.5, 0.5)}) specifiying the prior probabilities of analogue and no-analogue. Used to generate posterior probability of analogue using Bayes factors in plot 5 (\code{which = 5}).} \item{show.stats}{logical; should concise summary statistics of the ROC analysis be displayed on the plot?} \item{abline.col}{character string or numeric value; the colour used to draw vertical lines at the optimal dissimilarity on the plots.} \item{abline.lty}{Line type for indicator of optimal ROC dissimilarity threshold. See \code{\link{par}} for the allowed line types.} \item{inGroup.col}{character string or numeric value; the colour used to draw the density curve for the dissimilarities between sites in the same group.} \item{outGroup.col}{character string or numeric value; the colour used to draw the density curve for the dissimilarities between sites not in the same group.} \item{lty}{vector of at most length 2 (elements past the second in longer vectors are ignored) line types. The first element of \code{lty} will be used where a single line is drawn on a plot. Where two lines are drawn (for analogue and non-analogue cases), the first element pertains to the analogue group and the second element to the non-analogue group. See \code{\link{par}} for the allowed line types.} \item{caption}{vector of character strings, containing the captions to appear above each plot.} \item{legend}{character; position of legends drawn on plots. See Details section in \code{\link{legend}} for keywords that can be specified.} \item{ask}{logical; if \code{TRUE}, the user is \emph{ask}ed before each plot, see \code{par(ask=.)}.} \item{\dots}{graphical arguments passed to other graphics functions.} } \details{ This plotting function is modelled closely on \code{\link{plot.lm}} and many of the conventions and defaults for that function are replicated here. First, some definitions: \describe{ \item{\strong{TPF}}{ True Positive Fraction, also known as \emph{sensitivity}.} \item{\strong{TNF}}{ True Negative Fraction, also known as \emph{specificity}.} \item{\strong{FPF}}{ False Positive Fraction; the complement of TNF, calculated as 1 - TNF. This is often referred to a 1 - specificity. A false positive is also known as a type I error.} \item{\strong{FNF}}{ False Negative Fraction; the complement of TPF, calculated as 1 - TPF. A false negative is also known as a type II error. } \item{\strong{AUC}}{ The Area Under the ROC Curve.} } The "ROC curve" plot (\code{which = 1},) draws the ROC curve itself as a plot of the False Positive Fraction against the True Positive Fraction. A diagonal 1:1 line represents no ability for the dissimilarity coefficient to differentiate between groups. The AUC statistic may also be displayed (see argument \code{"show.stats"} above). The "Dissimilarity profile" plot (\code{which = 2}), draws the density functions of the dissimilarity values (\emph{d}) for the correctly assigned samples and the incorrectly assigned samples. A dissimilarity coefficient that is able to well distinguish the sample groupings will have density functions for the correctly and incorrectly assigned samples that have little overlap. Conversely, a poorly discriminating dissimilarity coefficient will have density profiles for the two assignments that overlap considerably. The point where the two curves cross is the optimal dissimilarity or critical value, \emph{d'}. This represents the point where the difference between TPF and FPF is maximal. The value of \emph{d} at the point where the difference between TPF and FPF is maximal will not neccesarily be the same as the value of \emph{d'} where the density profiles cross. This is because the ROC curve has been estimated at discrete points \emph{d}, which may not include excatly the optimal \emph{d'}, but which should be close to this value if the ROC curve is not sampled on too coarse an interval. The "TPF - FPF vs Dissimilarity" plot, draws the difference between the ROC curve and the 1:1 line. The point where the ROC curve is farthest from the 1:1 line is the point at which the ROC curve has maximal slope. This is the optimal value for \emph{d}, as discussed above. The "Likelihood ratios" plot, draws two definitions of the slope of the ROC curve as the likelihood functions LR(+), and LR(-). LR(+), is the likelihood ratio of a positive test result, that the value of \emph{d} assigns the sample to the group it belongs to. LR(-) is the likelihood ratio of a negative test result, that the value of \emph{d} assigns the sample to the wrong group. LR(+) is defined as \eqn{LR(+) = TPF / FPF} (or sensitivity / (1 - specificity)), and LR(-) is defined as \eqn{LR(-) = FPF / TNF} (or (1 - sensitivity) / specificity), in Henderson (1993). The \dQuote{probability of analogue} plot, draws the posterior probability of analogue given a dissimilarity. This is the LR(+) likelihood ratio values multiplied by the prior odds of analogue, for given values of the dissimilarity, and is then converted to a probability. } \value{ One or more plots, drawn on the current device. } \references{ Brown, C.D., and Davis, H.T. (2006) Receiver operating characteristics curves and related decision measures: A tutorial. \emph{Chemometrics and Intelligent Laboratory Systems} \bold{80}, 24--38. Gavin, D.G., Oswald, W.W., Wahl, E.R. and Williams, J.W. (2003) A statistical approach to evaluating distance metrics and analog assignments for pollen records. \emph{Quaternary Research} \strong{60}, 356--367. Henderson, A.R. (1993) Assessing test accuracy and its clinical consequences: a primer for receiver operating characteristic curve analysis. \emph{Annals of Clinical Biochemistry} \strong{30}, 834--846. } \author{Gavin L. Simpson. Code borrows heavily from \code{\link{plot.lm}}.} \seealso{\code{\link{roc}} for a complete example} % \examples{ % ## continue the example from roc() % example(roc) % ## draw the ROC curve % plot(swap.roc, 1) % ## draw the four default diagnostic plots % opar <- par(mfrow = c(2,2)) % plot(swap.roc) % par(opar) % } \keyword{hplot} \keyword{methods}
7,629
gpl-2.0
eb7969e33474cabdacf38a054adbc04cfb8d2d21
svazzole/sparsevar
man/plotIRFGrid.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/plotIRF.R \name{plotIRFGrid} \alias{plotIRFGrid} \title{IRF grid plot} \usage{ plotIRFGrid(irf, eb, indexes, type, bands) } \arguments{ \item{irf}{the irf object computed using impulseResponse} \item{eb}{the error bands estimated using errorBands} \item{indexes}{a vector containing the indeces that you want to plot} \item{type}{plot the irf (\code{type = "irf"} by default) or the orthogonal irf (\code{type = "oirf"})} \item{bands}{which type of bands to plot ("quantiles" (default) or "sd")} } \value{ An \code{image} plot relative to the impulse response function. } \description{ Plot a IRF grid object }
694
gpl-2.0
6a60c4535458fbf819cb4746ada78c5173232540
garrettgman/DSR
man/population.Rd
% Generated by roxygen2 (4.1.0): do not edit by hand % Please edit documentation in R/data.R \docType{data} \name{population} \alias{population} \title{Population data} \format{\preformatted{'data.frame': 4060 obs. of 3 variables: $ country : Factor w/ 219 levels "Afghanistan",..: 1 1 1 1 1 1 1 1 1 1 ... $ year : int 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 ... $ population: int 17586073 18415307 19021226 19496836 19987071 20595360 21347782 22202806 23116142 24018682 ... }} \source{ \url{http://www.who.int/tb/country/data/download/en/} } \usage{ population } \description{ Populations of 219 countries for 1995-2013. } \keyword{datasets}
667
cc0-1.0
473af27011715e772aea0b3f45bf7a7bad165764
gilestrolab/rethomics
rethomics/man/mins.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/utils_time.R \name{mins} \alias{mins} \title{Trivially converts minutes to seconds} \usage{ mins(x) } \arguments{ \item{x}{number of minutes} } \value{ the corresponding number of seconds } \description{ Trivially converts minutes to seconds } \seealso{ \code{\link{days}} \code{\link{hours}} }
373
gpl-3.0
00a4d5249447c6a39af1cdd377e2769680ca57b2
cran/FSAdata
man/WhiteGrunt2.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/WhiteGrunt2.R \docType{data} \name{WhiteGrunt2} \alias{WhiteGrunt2} \title{Ages, lengths, and sexes of White Grunt.} \format{A data frame with 465 observations on the following 3 variables. \describe{ \item{age}{Age (from otoliths to the nearest 0.1 years)} \item{tl}{Total length (mm)} \item{sex}{Sex (\code{male} and \code{female})} }} \source{ From (approximately) Figure 6 of Araujo, J.N. and A.S. Martins. 2007. Age, growth and mortality of white grunt (\emph{Haemulon plumierii}) from the central coast of Brazil. Scientia Marina 71:793-800. } \description{ Ages, lengths, and sexes of White Grunt (\emph{Haemulon plumierii}) collected from the central coast of Brazil } \section{Topic(s)}{ \itemize{ \item Growth \item von Bertalanffy } } \examples{ data(WhiteGrunt2) str(WhiteGrunt2) head(WhiteGrunt2) op <- par(mfrow=c(1,2),pch=19) plot(tl~age,data=WhiteGrunt2,subset=sex=="female",main="Female") plot(tl~age,data=WhiteGrunt2,subset=sex=="male",main="Male") par(op) } \concept{Growth} \concept{von Bertalanffy} \keyword{datasets}
1,178
gpl-2.0
7dd83317937fcbd7142668b327ce48d501e170aa
pegasus-isi/pegasus
packages/pegasus-dax-r/Pegasus/Workflow/man/Depends.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/workflow.R \name{Depends} \alias{Depends} \title{Add a dependency to the workflow} \usage{ Depends(workflow, child, parent, edge.label = NULL) } \arguments{ \item{workflow}{The Workflow object} \item{child}{The child job/dax/dag or id} \item{parent}{The parent job/dax/dag or id} \item{edge.label}{A label for the edge (optional)} } \value{ The Workflow object with the dependency appended } \description{ Add a dependency to the workflow } \seealso{ \code{\link{Workflow}}, \code{\link{Dependency}}, \code{\link{AddDependency}} }
612
apache-2.0
4f8585dbee4d58f2ed00ae050cddf7d3a8914202
kmcconeghy/flumodelr
man/mk_flu_form.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/mk_flu_form.R \name{mk_flu_form} \alias{mk_flu_form} \title{mk_flu_form: Build model formula for internal use} \usage{ mk_flu_form(outc, offset, poly, model_form) } \value{ an object of class formula } \description{ This function is not meant to be called directly, it takes input from user-called functions and builds a formula class object for use in regression commands. }
454
gpl-3.0
cb44684960cb6c0b8516916d757d54c8568d1aeb
moisesufmg/ExpDE
man/recombination_bin.Rd
% Generated by roxygen2 (4.1.1): do not edit by hand % Please edit documentation in R/recombination_bin.R \name{recombination_bin} \alias{recombination_bin} \title{/bin recombination for DE} \usage{ recombination_bin(X, M, recpars) } \arguments{ \item{X}{population matrix (original)} \item{M}{population matrix (mutated)} \item{recpars}{recombination parameters (see \code{Recombination parameters} for details)} } \value{ Matrix \code{U} containing the recombined population } \description{ Implements the "/bin" (binomial) recombination for the ExpDE framework } \section{Recombination Parameters}{ The \code{recpars} parameter contains all parameters required to define the recombination. \code{recombination_bin()} understands the following fields in \code{recpars}: \itemize{ \item \code{cr} : component-wise probability of using the value in \code{M}.\cr Accepts numeric value \code{0 < cr <= 1}. \item \code{minchange} : logical flag to force each new candidate solution to inherit at least one component from its mutated 'parent'.\cr Defaults to TRUE } } \section{References}{ K. Price, R.M. Storn, J.A. Lampinen, "Differential Evolution: A Practical Approach to Global Optimization", Springer 2005 }
1,348
mit
bf488306f771ac10de9c7167238b3ed1e42f4138
jread-usgs/mda.streams
man/config_to_metab_clusterfun.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/config_to_metab_clusterfun.R \name{config_to_metab_clusterfun} \alias{config_to_metab_clusterfun} \title{Create a function to pass to cluster nodes} \usage{ config_to_metab_clusterfun(config, return_value = c("metab_model", "file_name", "nothing"), repeat_times = NA, post_metab = TRUE, stage_folder = NULL, sb_user, sb_password, verbose = TRUE) } \arguments{ \item{config}{a data.frame containing the configuration information, or the name of a config file on the computer cluster node.} \item{return_value}{character. What should be returned when the function completes? "nothing" may be appropriate for many-model runs or large model objects.} \item{repeat_times}{either NA for no repetition, or an integer number of times to repeat the fit for each config row (using config_to_metab_repeat)} \item{post_metab}{logical. Should the metab model be staged and posted?} \item{stage_folder}{character. The folder name on the computer cluster node where the metab_model should be staged before posting (only applies if post_metab=TRUE). If NULL, the local tempdir() will be used.} \item{sb_user}{the ScienceBase username, only used if post_metab=TRUE} \item{sb_password}{the ScienceBase password, only used if post_metab=TRUE} \item{verbose}{logical. Should status messages be given?} } \description{ Returns a self-contained function (closure) with all the necessary information to run \code{\link{config_to_metab}} or \code{\link{config_to_metab_repeat}} on computer cluster nodes via \code{\link[parallel]{clusterApply}} or \code{\link[parallel]{clusterApplyLB}} } \examples{ \dontrun{ # might need to run this before calling clusterApplyLB, but might work all in one line clusterApplyLB(c1, 1:nrow(config), config_to_metab_clusterfun(config, rows)) } }
1,854
cc0-1.0
7b26cb1c9bc7ac9440159453cbed60dff4ed6481
pet-estatistica/labestData
man/MingotiAnA4.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Mingoti.R \name{MingotiAnA4} \alias{MingotiAnA4} \title{Dados Relativos \enc{à}{a}s Empresas} \format{Um \code{data.frame} com 46 observações e 6 variáveis, em que \describe{ \item{\code{emp}}{Identificação da empresa.} \item{\code{grp}}{Fator que indica o grupo em que a empresa está situada (1 = se a empresa faliu, 2 = se a empresa não faliu).} \item{\code{x1}}{Fluxo de caixa/ total de débitos.} \item{\code{x2}}{Rendimento da empresa/ total de patrimônio.} \item{\code{x3}}{Patrimônio atual/ total de débito.} \item{\code{x4}}{Patrimônio atual/ rendimento das vendas.} }} \source{ MINGOTI (2005), pág. 290. } \description{ Dados de 21 empresas, coletados aproximadamente 2 anos antes da falência das mesmas, e de outras 25 empresas que não faliram no período. } \examples{ data(MingotiAnA4) str(MingotiAnA4) library(car) scatterplotMatrix(~x1 + x2 + x3 + x4 | grp, data = MingotiAnA4, reg.line = FALSE, spread = FALSE, smoother = FALSE) } \keyword{AnaComPrin}
1,157
gpl-3.0
54e1f66cd9df9a6e2c9c9cca712f52e49f46ef5e
woobe/h2o
R/h2o-package/man/h2o.logAndEcho.Rd
\name{h2o.logAndEcho} \alias{h2o.logAndEcho} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Write and Echo Message to H2O Log } \description{ Write a user-defined message to the H2O Java log file and echo it back to the user. } \usage{ h2o.logAndEcho(conn, message) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{conn}{An \code{\linkS4class{H2OClient}} object containing the IP address and port of the server running H2O. } \item{message}{A character string to write to the H2O Java log file.} } \seealso{ \code{\linkS4class{H2OClient}, \link{h2o.downloadAllLogs}} } \examples{ library(h2o) localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE) h2o.logAndEcho(localH2O, "Test log and echo method.") } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ ~kwd1 } \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
934
apache-2.0
4483fef627232de5341b6301e6db7eeb7a83dc3d
Burke-Lauenroth-Lab/rSFSW2
man/res_to_polygons.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Spatial_Functions.R \name{res_to_polygons} \alias{res_to_polygons} \title{Convert resolution/rectangles into \code{\link[sp:SpatialPolygons-class]{sp::SpatialPolygons}}} \usage{ res_to_polygons(x, y, ...) } \description{ Convert resolution/rectangles into \code{\link[sp:SpatialPolygons-class]{sp::SpatialPolygons}} }
396
gpl-3.0
d2b204c34f77116338ade308d8345f719fbc0572
taranu/ProFit
man/profitMakeModel.Rd
\name{profitMakeModel} \alias{profitMakeModel} %- Also NEED an '\alias' for EACH other topic documented here. \title{ High-Level 2D Galaxy and Point Source Image Creation } \description{ Create an astronomical image containing model galaxies or point sources, with or without convolution with the PSF. This is achieved by providing a model list that contains the main parameters that define the model. } \usage{ profitMakeModel(model, magzero = 0, psf=NULL, dim = c(100, 100), serscomp = "all", pscomp = "all", rough = FALSE, acc = 0.1, finesample=1L, returnfine=FALSE, returncrop=TRUE, calcregion, docalcregion=FALSE, magmu=FALSE, remax, rescaleflux = FALSE, convopt=list(method="Bruteconv")) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{model}{ The model list that describes the analytic model to be created. See Details. } \item{magzero}{ The magntiude zero point, where values become scaled by the standard scale=10^(-0.4*(mag-magzero)) } \item{psf}{ The PSF matrix to use for the model. This will both be used to convolve the Sersic model and to model point sources (i.e.) stars. } \item{dim}{ The desired dimenions of the 2D image matrix. This should be a two element vector which specifies c(width,height) in the plotted image. This becomes c(rows,columns) in the matrix itself (see Details below). } \item{serscomp}{ Which component of the Sersic list should be used to create the model image. This is useful if you want to visually see appearance of e.g. Sersic components 1 and 2 separately. The default "all" will show the total model with all components added. See \code{\link{profitMakeSersic}} for details. } \item{pscomp}{ Which component of the PS list should be used to create the model image. This is useful if you want to visually see appearance of e.g. PS components 1 and 2 separately. The default "all" will show the total model with all components added. See \code{\link{profitMakePointSource}} for details. } \item{rough}{ Logical; should an approximate model image be created. If TRUE only one evalaution of the Sersic model is made at the centre of each pixel. If FALSE then accurate upsampling is used to create more precise pixel values. } \item{acc}{ Desired minimum per pixel accuracy within the upscaling region defined by \option{RESWITCH}. \option{ACC} specifies the allowed fractional difference from adjacent pixels before recursion is triggered. Smaller (i.e. 0.01) means more accurate integration, but increased computation time. } \item{finesample}{ Integer specifying the number of times to subdivide the model image and therefore finely sample it (compared to the dimensions specified in \option{dim}), for more accurate PSF convolution. Must be one or higher. Note that the \option{psf} image and \option{model} PSF are not automatically fine sampled; this is only done by \code{\link{profitSetupData}}. } \item{returnfine}{ Logical flag to return the finely-sampled model instead of downsampling to the specified \option{dim}. } \item{returncrop}{ Logical flag to return the appropriately PSF-padded \option{model} instead of cropping to the specified \option{dim}. } \item{calcregion}{ Matrix; logical image matrix the same size as the input \option{image} matrix. If \option{docalcregion}=TRUE, then pixels in \option{calcregion} that are TRUE (or 1) will have the convolution calculated, pixels with FALSE (or 0) values will be set to 0. This is included to increase computation speed in situations where only a small region of the full image contains the galaxy of interest for fitting. In this case pixels a long way from the segmentation region for the galaxy will not need to be convolved in order to calculate the correct likelihood within the segmentation. } \item{docalcregion}{ Logical; should the \option{calcregion} logical matrix be used to define a subset of pixels to be convolved. } \item{magmu}{ Logical vector. If TRUE then the mag parameter in the input \option{model} list is interpreted as the mean surface brightness within Re in units of mag/pix^2. If this is of length 1 then all mag values will be interpreted in the same sense, otherwise it should be the same length as the number of components being generated. If FALSE mag is taken to mean total magnitude of the integrated profile. Using this flag might be useful for disk components since they occupy and relatively narrow range in surface brightness, but can have essentially any total magnitude. } \item{remax}{ If provided the profile is computed out to this many times Re, after this point the values in the image are set to zero. If missing the profile is calculated out to the radius at which 99.99\% of flux is contained within the elliptical isocontour. } \item{rescaleflux}{ Logical; where the profile has been truncated via \option{remax} this specifies whether the profile should be rescaled since the total integrated flux will be less than without truncation. In practice this means image values are increases by 1/0.9999 for the default case (where the profile is truncated at the point where 99.99\% of flux is contained). } \item{convopt}{ A list specifying options for convolution. See } } \details{ A legal model list has the structure of list(sersic, psf, sky). At least one of sersic, psf or sky should be present. Each of these is itself a list which contain vectors for each relevant parameter. All these vectors should be the same length for each type of model structure. The parameters that must be specified for \option{sersic} (see \code{\link{profitMakeSersic}} for details) are: \describe{ \item{xcen}{Vector; x centres of the 2D Sersic profiles (can be fractional pixel positions).} \item{ycen}{Vector; y centres of the 2D Sersic profiles (can be fractional pixel positions).} \item{mag}{Vector; total magnitudes of the 2D Sersic profiles. Converted to flux using 10^(-0.4*(\option{mag}-\option{magzero})).} \item{re}{Vector; effective radii of the 2D Sersic profiles} \item{nser}{Vector; the Sersic indicies of the 2D Sersic profiles} \item{ang}{Vector; the orientation of the major axis of the profile in degrees. When plotted as an R image the angle (theta) has the convention that 0= | (vertical), 45= \, 90= - (horizontal), 135= /, 180= | (vertical). Values outside the range 0 <= ang <= 180 are allowed, but these get recomputed as ang = ang \%\% 180.} \item{axrat}{Vector; axial ratios of Sersic profiles defined as minor-axis/major-axis, i.e. 1 is a circle and 0 is a line.} \item{box}{Vector; the boxiness of the Sersic profiles that trace contours of iso-flux, defined such that r[mod]=(x^(2+box)+y^(2+box))^(1/(2+box)). When \option{box}=0 the iso-flux contours will be normal ellipses, but modifications between -1<box<1 will produce visually boxy distortions. Negative values have a pin-cushion effect, whereas positive values have a barrel effect (the major and minor axes staying fixed in all cases).} } The parameters that must be specified for pointsource (see \code{\link{profitMakePointSource}} for details) are: \describe{ \item{xcen}{Vector of x centres of the PSFs (can be fractional pixel positions).} \item{ycen}{Vectors of y centres of the PSFs (can be fractional pixel positions).} \item{mag}{Vectors of total magnitudes of the PSFs. Converted to flux using 10^(-0.4*(\option{mag}-\option{magzero})).} } The parameter that must be specified for \option{sky} is: \describe{ \item{bg}{Value per pixel for the background. This should be the value as measured in the original image, i.e. there is no need to worry about the effect of \option{magzero}.} } An example of a legal model structure is: model = list(\cr sersic = list(\cr xcen = c(180.5, 50),\cr ycen = c(90, 50),\cr mag = c(15, 13),\cr re = c(140, 50),\cr nser = c(10, 4),\cr ang = c(60, 135),\cr axrat = c(0.5, 0.3),\cr box = c(2,-2)\cr ),\cr pointsource = list(\cr xcen = c(34,10,150),\cr ycen = c(74,120,130),\cr mag = c(10,13,16)\cr ),\cr sky = list(\cr bg = 3e-12\cr )\cr )\cr By ProFit convention the bottom-left part of the bottom-left pixel when plotting the image matrix is c(0,0) and the top-right part of the bottom-left pixel is c(1,1), i.e. the mid-point of pixels are half integer values in x and y. To confuse things a bit, when R plots an image of a matrix it is transposed and re-ordered vertically to how it appears if you print the matrix directly to screen, i.e. compare print(matrix(1:4,2,2)) and image(matrix(1:4,2,2)). The lowest value (1) is top-left when printed but bottom-left when displayed using image (the red pixel). Both are "correct": the issue is whether you consider the first element of a matrix to be the Cartesian x position (movement in x) or a row element (movement in y). Matrices in maths are always written top-left first where the first argument refers to row number, but images by convention are accessed in a Cartesian sense. Hence [3,4] in a maths matrix means 3 down and 4 right from the top-left, but 3 right and 4 up from the bottom-left in an image. } \value{ List; structure containing the specified model: \item{x}{Vector with elements 0:dim[1]} \item{y}{Vector with elements 0:dim[2]} \item{z}{Matrix; contains the flux values of the specified model image. Dimensions \option{dim}} } \author{ Aaron Robotham & Dan Taranu } \seealso{ \code{\link{profitMakeSersic}}, \code{\link{profitConvolvePSF}} } \examples{ model = list( sersic = list( xcen = c(180, 60), ycen = c(90, 10), mag = c(15, 13), re = c(14, 5), nser = c(3, 10), ang = c(46, 80), axrat = c(0.4, 0.6), box = c(0.5,-0.5) ), pointsource = list( xcen = c(34,10,150), ycen = c(74,120,130), mag = c(10,13,16) ), sky = list( bg = 3e-12 ) ) # Without a PSF provided only the extended sources are shown, with no convolution: magimage(profitMakeModel(model=model, dim=c(200,200))) # With a PSF provided the PSFs are displayed and the extended sources are convolved with # the PSF: magimage(profitMakeModel(model=model, psf=profitMakePointSource(), dim=c(200,200))) } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ Model } \keyword{ Sersic }% __ONLY ONE__ keyword per line
10,273
gpl-3.0
54e1f66cd9df9a6e2c9c9cca712f52e49f46ef5e
janezhango/BigDataMachineLearning
R/h2o-package/man/h2o.logAndEcho.Rd
\name{h2o.logAndEcho} \alias{h2o.logAndEcho} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Write and Echo Message to H2O Log } \description{ Write a user-defined message to the H2O Java log file and echo it back to the user. } \usage{ h2o.logAndEcho(conn, message) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{conn}{An \code{\linkS4class{H2OClient}} object containing the IP address and port of the server running H2O. } \item{message}{A character string to write to the H2O Java log file.} } \seealso{ \code{\linkS4class{H2OClient}, \link{h2o.downloadAllLogs}} } \examples{ library(h2o) localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE) h2o.logAndEcho(localH2O, "Test log and echo method.") } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ ~kwd1 } \keyword{ ~kwd2 }% __ONLY ONE__ keyword per line
934
apache-2.0
656b160402a009f2b7dc28e232e7f38b6a25c10b
wush978/Rhiredis
man/redisOBJECT.Rd
\name{redisOBJECT} \alias{redisOBJECT} \title{Inspect the internals of Redis objects} \usage{ redisOBJECT(subcommand, Rc = NULL) } \description{ Inspect the internals of Redis objects }
191
gpl-3.0
7c4486d2a9a0168944b500eb3679a2ad5f1953ff
sigopt/SigOptR
man/sigopt_api_user_agent.Rd
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/sigopt_api_wrapper.R \name{sigopt_api_user_agent} \alias{sigopt_api_user_agent} \title{User agent for current version of SigOpt R API Client} \usage{ sigopt_api_user_agent() } \value{ User agent } \description{ User agent for current version of SigOpt R API Client } \seealso{ \code{\link{sigopt_GET}} and \code{\link{sigopt_POST}}, which perform the HTTP requests }
446
mit