On May 23, 2016, at 10:59 AM, jlu...@ria.buffalo.edu wrote:
>
> R users:
>
> Suppose I have a function that takes three numeric arguments x, y, and z,
> any of which may be scalars or vectors.
> Suppose further that the user takes one of the arguments, say y, as a
> vector with the other two
Scalar values in R are just vectors of length 1. The "promotion" you are
thinking of is "recycling" that automatically occurs when vectors of different
lengths are supplied to certain operations.
One shortcut might be to put them all into a data frame using the data.frame()
function. Otherwis
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of
> Suppose I have a function that takes three numeric arguments x, y, and z, any
> of which may be scalars or vectors.
> Suppose further that the user takes one of the arguments, say y, as a vector
> with
R users:
Suppose I have a function that takes three numeric arguments x, y, and z,
any of which may be scalars or vectors.
Suppose further that the user takes one of the arguments, say y, as a
vector with the other two as scalars.
Is there an existing R function that will promote the other two
4 matches
Mail list logo