1 Reply Latest reply: Aug 9, 2017 3:21 AM by Bas van Reeuwijk RSS

    Unable to use computed value from R as Dimension

    Michael Vineis

      Problem: I am unable to use a value computed in R as a dimension in a plot.

       

      Background: I am trying to create a histogram of the residuals from a simple linear regression, similar to this plot:

      In order to obtain the residuals, I am using the following expression:

       

      R.ScriptEval('lm(q$medv ~ q$lstat)$residuals', medv, lstat)

       

      Note that both the inputs and the output from R are numeric variables. I used the same script as a Measure expression in a scatterplot and it worked as expected. However, when I attempt to use the script to create a dimension in a histogram or a bar chart, I receive an 'Internal engine error'.

       

      Question: Is there something about the way dimensions are used that would prevent me from using a numeric vector returned from R?