js-call-r | Javascript call R function with a simple way | Runtime Evironment library
kandi X-RAY | js-call-r Summary
kandi X-RAY | js-call-r Summary
Javascript call R function with a simple way.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Call an asynchronous function
- Call a script .
- Call a script .
- Parses stdout std output .
js-call-r Key Features
js-call-r Examples and Code Snippets
Community Discussions
Trending Discussions on js-call-r
QUESTION
I'm trying to call a function from R script. I'm using r-script like bellow :
...ANSWER
Answered 2018-May-21 at 01:02I finally found the solution for my problem. Actually r-script or js-call-r didn't help me calling R function. Here is what I did:
I used plumber package on R, so it creates a localhost so I could call my R functions via http request. Full documentation is on their website but here are the steps I took to set it up:
a- Open R Gui (64bit) Note: if you don't have R, go download it from: cran.r-project.org/mirrors.html
b- If you don't have plumber package, install it with R GUI with command: install.packages("plumber")
c- To check if R Gui root directory is at the file you want, send command: getwd()
d- If it's not the path you want, change it with: setwd("C:/your/Desired/Path")
e- Copy your R file into the same directory that you set in previous step
f- Send this command to start reading your R file: pr <- plumber::plumb("YourRFile.R")
g- run this command so it will run the local host: pr$run()
h- it should give you the port number so you can send receive messages
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install js-call-r
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page