Learn R Programming

tinyarray (version 2.4.3)

cor.one: cor.test for one variable with all variables

Description

cor.test for all variables(each two columns)

Usage

cor.one(
  x,
  var,
  drop.var = min(x[, var]) - 0.001,
  drop.other = min(x[, -which(colnames(x) == var)]) - 0.001,
  min.obs = 10
)

Value

A data.frame with cor.test p.value and estimate

Arguments

x

A numeric matrix or data.frame

var

your chosen variable,only one.

drop.var

drop values in var

drop.other

drop values in other columns

min.obs

minimum number of observations after dropping

Author

Xiaojie Sun

See Also

cor.full

Examples

Run this code
x = iris[,-5]
cor.one(x,"Sepal.Width")

Run the code above in your browser using DataLab