Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have Sense Server November 2017 release. I have installed the R Plugin and I am able to run the R examples provided. So, apparently the plugin is working.
However, when I try to use it with my own data I am not able to make it work.
For example, if I add a text object and write the following expression, I get no result. Not even an error, just a blank text. There are absolutely no blank values.
R.ScriptEval('mean(q$BMI);', BMI)
Issue number 2:
When I try to execute an R command in the script, I get this error "Client specified an invalid argument."
This is the code. The source R file runs fine in R Studio.
TempR:
LOAD '$(vRSource)' As RSource
Autogenerate 1;
R:
NoConcatenate
LOAD
R.ScriptEvalStr('source(q$RSource);', RSource) as R_Output
Resident TempR;
1. As I noticed in all examples when they indicate data they write like this: BMI as bmi. I am not sure if it matters but if there are no other ideas I would try.
2. For aggregations you need to use aggregate versions of the function:
R.ScriptAggr('mean(q$BMI);' BMI as BMI)
3. You need to be careful when using Str version of the function and passing numerical data. Maybe you could use:
R.ScriptEvalExStr('N', 'source(q$RSource);', RSource as RSource)
1. As I noticed in all examples when they indicate data they write like this: BMI as bmi. I am not sure if it matters but if there are no other ideas I would try.
2. For aggregations you need to use aggregate versions of the function:
R.ScriptAggr('mean(q$BMI);' BMI as BMI)
3. You need to be careful when using Str version of the function and passing numerical data. Maybe you could use:
R.ScriptEvalExStr('N', 'source(q$RSource);', RSource as RSource)
For Issue number 2:
Qlik always expect some value to be returned from SSE and actually the source R function does not return anything unless the parameter echo = TRUE.
So the following should work for you:
R.ScriptEvalStr('source(toString(q$RSource[1]), echo = TRUE);', RSource) as R_Output
Is there any documentation for these R.Script functions?
Hi Igor!
Yes, the documentation can be found here server-side-extension/writing_a_plugin.md at master · qlik-oss/server-side-extension · GitHub
Regards,
Josefine