# NOT RUN {
# using a built in dataset
cor2cov(cor(longley), sapply(longley, sd))
# should match the above covariance matarix
cov(longley)
all.equal(cov(longley), cor2cov(cor(longley), sapply(longley, sd)))
# }
Run the code above in your browser using DataLab