rperformanceanalytics

Issue downloading and running PerformanceAnalytics in R


I am starting to learn portfolio analysis in R using the PerformanceAnalytics package, and I was wondering if anyone else has had issues downloading it. I end up getting the following error:

require("PerformanceAnalytics")

Loading required package: PerformanceAnalytics
Error: package or namespace load failed for ‘PerformanceAnalytics’ in 
loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘quadprog’
Warning message:
package ‘PerformanceAnalytics’ was built under R version 3.4.3 

I tried downloading quadprog, but that didn't seem to do anything. Any help would be appreciated!


Solution

    1. Do .libPaths() and remove the PerformanceAnalytics and quadprog packages.
    2. Upgrade R to the newest version (should run on R > 3.0.0. but this may cause a problem).

    Two options then.

    1. install.packages("PerformanceAnalytics, dependencies = TRUE)
    2. Install the packages step by step: Install quadprog first and then install PerformanceAnalytics