DefinitelyTyped/types/r-script/r-script-tests.ts
2017-08-16 10:10:53 -07:00

23 lines
693 B
TypeScript

import R = require('r-script');
function RPromise(r: R): Promise<any> {
return new Promise((resolve, reject) => {
r.call((err, d) => {
if (err) {
reject(err);
} else {
resolve(d);
}
});
});
}
const options: R.Options = {
dataframe: "rows",
anotherRandomOption: true
};
const result1 = R("foo.R").data("string data param", "another one").callSync();
const result2 = R("foo.R").data("string data param", "another one").callSync(options);
R("foo.R").data("string data param", "another one").call(options, (err, d) => d);
R("foo.R").data("string data param", "another one").call((err, d) => d);