i have two data frames in R say data1 and data2:
a = c(1,2,NA,4,5)
b = c(3,4,5,6,7)
data1 = tibble(a,b);data1
a = c(4,2,4,4,9)
b = c(3,4,4,6,7)
d = c(5,9,3,4,2)
data2 = tibble(a,b,d);data2
i want to calculate the correlation of these two data frames matched columns.Keep in mind that i might have NA in some column vectors and also some columns might not exist in the initial data frame 1 which ideally i want to report NA.How i can do that in R using dplyr ?