Is it possible to find the p-value in pearson correlation in R?

To find the pearson correlation, I usually do this

col1 = c(1,2,3,4)
col2 = c(1,4,3,5)
cor(col1,col2)
# [1] 0.8315218


But how I can find the p-value of this?

you can use cor.test : 

col1 = c(1,2,3,4) 
col2 = c(1,4,3,5)
cor.test(col1,col2) 


which gives :

# Pearson's product-moment correlation   
# data:  col1 and col2   
# t = 2.117, df = 2, p-value = 0.1685   
# alternative hypothesis: true correlation is not equal to 0   
# 95 percent confidence interval:   
#  -0.6451325  0.9963561   
# sample estimates:   
#       cor    
# 0.8315218    


More information about the statistics and extra parameters at the official page: 

https://stat.ethz.ch/R-manual/R-patched/library/stats/html/cor.test.html
