r-integration
r-integration copied to clipboard
Can we return a list from this package to node?
We are using this package as r-script was giving issues, maybe due to old version or so. We have a data like: [ [0, 0.2, 0.4], [0.2, 0.5, 0.2], ]
It shows up fine in R but when this value is fetched in node using this library, the output is ['[' , '[', '0', ',', ..........]
Could you provide more details about the type of data you want to transfer from R to Node JS?
Currently, the library only allows for the parsing of data types that can be represented as JSON, such as numbers and vectors. If you encounter this limitation, one potential solution is to manually transfer the data from R to NodeJS using an intermediary step, such as using files. For instance, if you wish to transfer a matrix, you can use the following code in R:
mat <- matrix(rnorm(100), ncol = 10)
write.table(mat, "test.csv")
You can then read the resulting CSV file in NodeJS using an appropriate library.