p_cor: Finds correlation coefficients, with support for piping

View source: R/p_cor.r

p_corR Documentation

Finds correlation coefficients, with support for piping

Description

A wrapper function for cor(), with support for piping.

Usage

p_cor(data, x, y, ...)

Arguments

data

the data

x

one of the two variables

y

one of the two variables

...

additional arguments passed to stats::cor().

Value

a numeric object

Examples

# load the data
data(nhanes)

# get correlation coefficient for systolic and diastolic
nhanes |> p_cor(bpxosy1,bpxodi1,use='complete.obs')

baseverse documentation built on April 29, 2026, 1:08 a.m.