-
Simple linear regression with opencpu
2016-08-30
SourceI’ve released an opencpu app in the package ocpusimplereg. It performs a simple linear regression. In this app, the user:
uploads the data from a CSV file;
selects the two columns used for the regression;
clicks on a button to generate a report.
Of course the report deserves to be improved. My purpose is just to demonstrate how one can use
opencpu
to create such an app.Only one R function is used. It takes as arguments the dataframe, the confidence level and the format of the outplut file, and it knits the template included in the package.
In addition to
jQuery
andopencpu.js
, the app uses three Javascript libraries:Papa Parse, to convert the CSV file to a JSON object;
jsonTable, to create a table from a JSON object, as explained here;
jqPlot, to do an awesome Javascript plot.
You can play with the app by following this link, but obviously the report generation is not available.