none
Having trouble loading CSV into workspace with JavaScript RRS feed

  • Question

  • I recently found a tutorial posted in the Microsoft Developer Network on the Client Library Tutorial for DeployR .

    I am using DeployR to create a web app that will allow a user to upload a CSV file and perform some R analytics on the data contained in the CSV. I have the functionality of the app running with the Iris data-set (i.e. currently, the app creates graphs and clusters for the Iris data-set.) I would now like to upload my own data and perform the same analysis on the uploaded data as I have done with the Iris data-set but this is where I am running into a problem.

    I have managed to allow for a CSV file to be uploaded from the web app into my DeployR repository but when I try to load the CSV  from the repository into a DeployR workspace to perform analysis on the data I get an error message: "cannot open the connection". I can manually load the CSV into the workspace using the "Load" tab located at the top right corner of the Repository Manager. However, I would like to load the file into the workspace from the web app using a JavaScript call if that is possible.

    I recently found a tutorial posted in the Microsoft Developer Network on the Client Library Tutorial for DeployR .

    After reading the Tutorial that I mentioned above I found a JavaScript code snippet in it which seemed to carry out the function I am describing but I could not seem to get it to work for me. I have pasted the code below:
    // // 2. Load a repository-managed file into the working directory. // deployr.io('/r/repository/file/fetch') .data({ filename: 'data.csv', directory: 'demo', author: 'george' }) .end() .io('/r/project/directory/load') .data({ project: rProject, filename: 'data.csv' }) .end();


    My question is: Can you send me an example JavaScript that would take a csv file from my DeployR repository and load it into the working directory so I can perform some R analytics on the data from a front end app.


    Any help on this issue would be much appreciated.

    Monday, June 27, 2016 1:39 PM