3 Replies Latest reply on Nov 4, 2016 7:36 AM by Yuriy Fal

    Using R to calculate annualized returns?

    luciana.suran.1

      Hi,

       

      I am a newbie at integrating R with Tableau but yesterday I got my first calculation to work (covariance). The calculated field I ended up using was the following:

       

      SCRIPT_REAL("cov(.arg1, .arg2)", SUM( [Fund]), SUM( [Bmark]))

       

      Worked like a charm! Now I am trying to see if I can calculated annualized returns using R. I installed the PerformanceAnalytics package in RStudio and the used the following command:

       

      SCRIPT_REAL("Return.annualized(.arg1)", SUM( [Fund]))

       

      and I get the following error message below. I can't tell if my code is wrong and/or the package wasn't installed correctly. Would be hugely thankful if anyone can identify my mistake.

       

      Thanks!