We combine Rook, jQuery, and Bootstrap to make a nice-looking, R-based web-application.
A list of the required packages are provided here.
To install a package:
install.packages('Rook')The first parameter can also be a vector of multiple packages.
$ ./main
Attaching package: ‘jsonlite’
The following object is masked from ‘package:utils’:
View
starting httpd help server ... done
Server started on host 127.0.0.1 and port 5000 . App urls are:
http://127.0.0.1:5000/custom/test_project
To view the website, open the following in your browser:
http://127.0.0.1:5000/custom/test_project/html/index.html
This project was developed against Chrome.
- We use Rscript to be able to create an executable script to boot the application.
- We use Rook's Builder class to route the requests.
- We send raw user-code to the server and dynamically execute it.
- We use JSON in the Ajax communication.
- We serve images by redirecting the output device to a temporary-file and then using the same file in the response (after setting the content-type).
