r value statistics

To calculate the r value statistics in R, you can use the cor.test() function to compute the Pearson correlation coefficient, which measures the strength and direction of the linear relationship between two variables. The cor.test() function also provides the p-value, which indicates the significance of the correlation coefficient. Additionally, you can use the cor() function to compute the correlation matrix for multiple variables, providing a comprehensive view of the relationships among the variables in your dataset.