r inside max?

Tobias Rosenberger's icon

recently I started to learn a little bit scripting & programming with r. There is lots of literature available, and its really great to analyze/process/output data. This made me think that it would be absolutely awesome if r could be used inside max to fill / manipulate / query jit.matrix and dict. While I also try to learn a little bit js right now, I have the impression that you can do many things much faster and easier with R (and its packages). I believe I once read about something like an r external somebody wrote for max, but I can't find it anymore...

Thinksamuel's icon

Somebody used R in the past: http://civilstat.com/2013/01/audiolyzr-data-sonification-with-r/
and the direct link to the package: http://cran.r-project.org/web/packages/audiolyzR/index.html
(I have not used Audiolyzr myself but R is definitely an interesting language)

Tobias Rosenberger's icon

Thanks, that was very helpful and actually what I was looking for... After reading about their approach with json now, I did a simple test to fill dicts withs lists generated by R, which works smoothly with the standard jsonlite package...
simple example in R:
library(jsonlite)
cat(toJSON(list(foo = c(1, 2), bar = "hello world")), file = 'testjson.json')

now I look for a way to get data from r directly into a jit.matrix, preferable without use of dict, but with a file generated by a custom function that can be read by jit.textfile (which I think to behave somehow buggy)

Tobias Rosenberger's icon