What are the difference between cor.test and with function in R?

r
correlation

#1

I am studying about the correlation function which is inbuilt in R for finding the correlation.I came across two function one cor.test and other is with.

with- with is a generic function that evaluates the expression in a local environment constructed from data.

cor.test - The three methods each estimate the association between paired samples and compute a test of the value being zero. They use different measures of association, all in the range [-1, 1] with 0 indicating no association.

I want to difference between them and where to use them.


#2

@sid100158 - There is a big difference between them with function can be used to calculate any parameter for example if you want to calculate the correlation or max you can apply the with function.

For cor.test is used to calculate to only the correlation of two variable from the data set by using correlation type Pearson’s.

Hope this helps!

Regards,
Hinduja