如何在NodeJS中读取和执行r?
test.R文件:
var R = require('r-script')
var out = R("./test.R")
.data()
.callSync();
console.log(out)
app.js文件:
null
获得如下输出:
import numpy as np
import tensorflow as tf
arr = np.array([2., 4., 5., 9.])
tf.keras.utils.to_categorical(arr, 10)