Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'data' of undefined and outdated ex-async.R #27

Open
johnlin89 opened this issue Oct 24, 2018 · 0 comments
Open

Cannot read property 'data' of undefined and outdated ex-async.R #27

johnlin89 opened this issue Oct 24, 2018 · 0 comments

Comments

@johnlin89
Copy link

johnlin89 commented Oct 24, 2018

I ran npm install r-script in Users//Documents/workspace-neon/mss-server/ and was testing the example R scripts and javascripts. Specifically example.js with ex-sync.R.

My path was /Users//Documents/workspace-neon/mss-server/node_modules/r-script/example/ and I ran:
node ex.js

I kept getting

    at Object.<anonymous> (/Users/linjo/Documents/workspace-neon/mss-server/node_modules/r-script/example/ex.js:6:3)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

I believe the fix is documented in https://stackoverflow.com/questions/50093298/r-integration-with-node-script-using-r-script

In index.js, the init function should be:

function init(path) {
  var obj = new R(path);
  _.bindAll(obj, "data", "call", "callSync");
  return obj;
}

Also, in ex-async.R you need to change summarize_each to summarize_all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant