powered by
Computes correlation matrix with significance levels and generates publication-ready correlation table and plot.
correlation_analysis( data, method = "pearson", plot = TRUE, digits = 3, verbose = TRUE )
List with correlation matrix and significance matrix
Data frame with numeric variables
Correlation method: "pearson", "spearman", or "kendall"
Logical, whether to generate correlation plot
Number of decimal places
Logical. If TRUE (default), prints formatted output to console.
Lalit Kumar Rolaniya, ICAR-IIPR, Bikaner
data <- data.frame( yield = c(1200, 1350, 1100, 1450, 1280), wue = c(4.2, 4.8, 3.9, 5.1, 4.5), protein = c(22.1, 23.5, 21.8, 24.2, 22.9) ) correlation_analysis(data)
Run the code above in your browser using DataLab