Learn R Programming

cwhmisc (version 2.1)

my.var: Correlation, Variance and Covariance (Matrices)

Description

my.var and my.cor are deprecated, use var, cor and cov. For backward compatibility they are kept, but are implemented as calls to the new functions.

Usage

my.var(x, y) -> var(x, y = NULL, na.rm = TRUE, use = "complete")
my.cor(x, y) -> cor(x, y = NULL, use = "complete")

Arguments

x
a numerical vector, matrix or data frame.
y
a numerical vector of the same length as x

Value

  • matrix, if x and y have more than one column.

Examples

Run this code
datavec <- datavec1 <- matrix(rnorm(100),10,10)
datavec1[1,2] <- datavec1[5,7] <- NA
my.var(datavec)
my.var(datavec1)
<testonly>## regression test for PR#376</testonly>

Run the code above in your browser using DataLab