iter_cor: Iteration of correlation analyses with a specific variable

Description Usage Arguments Value Examples

View source: R/iter_cor.R

Description

This function perform multiple correlation analyses between a specific variable and various continuous variables

Usage

1
iter_cor(data, varlist, var, method = "pearson", print.result = F, p.round = 3)

Arguments

data

a dataframe to be used

varlist

a vector of continuous variables

var

a variable of interest

method

a character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman", can be abbreviated.

print.result

a logical indicating whether to show significant variables

p.round

a specified number of decimal places to which rounds the values

Value

Dataframe containing the result of correlation analyes

Examples

1
iter_cor(data=mtcars, varlist=c("cyl", "wt", "hp"), var="mpg", print.result=T, p.round=4)

nephroj/medicj documentation built on Dec. 22, 2021, 12:10 a.m.