Learn R Programming

KarsTS (version 2.4.1)

myApplyVector: myApplyVector: apply type function

Description

This function applies a function to the elements of a vector so that the result for each element is located in a row in a matrix. It is used internally.

Usage

myApplyVector(FUN = NULL, dataVector = NULL, out.ncols = 1, ...)

Arguments

FUN

the function to apply

dataVector

The vector to which elements apply the function

out.ncols

Number of columns for the output matrix

Further arguments to passed

Examples

Run this code
# NOT RUN {
exampleF <- function(X){c(X + 5, X*5)}
myApplyVector(FUN = exampleF, dataVector = 1:10, out.ncols = 2)

# }

Run the code above in your browser using DataLab