Opencpu and R-statistics - r

I am wanting to use OpenCpu to do statistical web-based apps.
BUT, the documentation I see on the web seems to be contradictory.
Just trying to get started is difficult for a newbie.
I hope someone knows how.
I have seen some posts here on stackoverflow, and I still see contradictions.
Note that I have used Rserve in java and Rpy2 in python, and these are wrappers to R-stats.
BUT on the website I see that they say that OpenCpu is an embedded engine using HTTP.
I wish to install this OpenCpu on my local Ubuntu machine.
So my question is:
(1)Does OpenCpu server contain some embedded version of R-statistics?
SO the download contains everything i need.
OR
(2)does one have to install R-statistics separately and the OpenCpu server separately,
so hence these are 2 separate applications that talk to one another over HTTP.
So you can see that I was not able to find this kind of fundamental starting knowledge on the web.

Doing apt-get install opencpu will automatically install R. Not because it is contained, but because it is declared as a dependency, so the package manager understands it needs R, apache, etc when it installs opencpu.

Related

Can people without R installed run an R Notebook file successfully?

I have an R Notebook that I am building to provide an analysis for somebody, and I am wondering if I should choose another option as I don't know if she will be able to run the Notebook without having R installed.
Is it possible to run an R Notebook as a single entity or must you have R installed in order to do it?
To rerun the notebook they require R. But the whole point of R Notebooks is that they produce a static document as output. That document (usually in HTML format) can be shared in isolation, and does not require any additional software besides a web browser to be viewerd.
Notebook will need R to run. To distribute a notebook without the R dependency will be a bit more elaborate, like installing rstudio server within a docker container. User will, in this particular case, need to have Docker installed and know how to start a container. From there on the user can interact with the code through a web browser.
Another option would be to use the cloud solution that some companies offer. It offers sharing functionality and you don't have to worry about the infrastructure or distribution of your work. There are some free plans that may work for you, but the real power is in premium features.

Test R app via openCPU localy

I wrote an R package and now I want to provide let's say a small demo fronted as a webapplication. For this I already wrote a index.html file which I saved to the <pkgRoot>/inst/www/ folder. I also installed the opencpu package which works fine wehen I use it via the localhost:<portNum>/ocpu/test/ "Interface", where I already can see my Package and use the Ajax POST and GET requests in order to see the package is doing what it's ment to do.
But now im stuck in a sense that I do not know how to test my own app (index.html) localy.
localhost:<portNum>/ocpu/<pkgName>/www/index.html does not work.
As I understood it, the opencpu Comes with the Apache 2 and hence ist not neccessary to set up an additional webserver?
When I check the path to the installed package the www folder as well as the index.html seem to be exactly were they should be, as far as I understand it.
Do i somehow have to install the app via the
opencpu::install_apps("pkgName")
inside R? Becaue if I try to do this, it seems there is no way to install local apps but only apps hosted at github.
.... and I just want to test the app localy!
Realy happy for any suggestions
Just use
opencpu::ocpu_start_app("pkgName")
That should start an HTTP server in R and launch your browser.

R: Terminal IDE for Centos6 server without admin access

I need a replacement for RStudio Server which I can install and manage myself on a remote server (no sudo access). Gedit + XQuartz on my MacBook performs very poorly due to the lack of integration with R.
I was looking at vimR, and it appears to have the functionality that I need and should be able to easily extend to Python and other programming languages, which is important. But I think this guide is out of date, and the installation of dependencies is convoluted and ultimately requires installing via the package manager which is not an option.
Are there other alternatives to this? Google has not brought up anything useful so far.

Building R package for windows on mac

Question:
I am developing an R package. I have not yet submitted to CRAN (and it's not ready to at any rate). I want to send the package to friend for some preliminary testing (he's not a builder) and I just want to see if he can use a few features.
On my Mac version of RStudio, I can generate binaries easily. It creates a file called "iatgen_1.0.tgz"
Can my friend use that to install my early build on his windows machine? Or do I need to do something to that file to make it usable for a windows user. Let's assume I have NO access to a windows machine. What can I do from my mac to make this package usable by windows users?
I am posting my comment as an (extended) answer because I think it will help you. When I built my package, I did not have access to Windows either and was suffering from the same issue. I discovered the the Windows build service offered at http://win-builder.r-project.org/ and it worked great. You'll need to do a few things before you send it in, and this is all explained on the site.
First, build your source package with R CMD build. Next, check the package with R CMD check. If this succeeds, follow the rest of the instructions on the site and if all goes well they will send you a link to the temporary directory on their server where you can download the Windows build. If all does not go well, Mr. Ligges will send you an email with the detailed issues so you can fix them and try again.
Like I said, the service worked very well for me. The response was prompt and there were absolutely no problems.

how to clone an RStudio environment on a different machine

i've been getting up to speed using R of late, and am wondering what the most efficient way is to clone an RStudio environment, especially the package installations, from one machine to another. i'd like to be able to switch from my desktop machine to my laptop, but i am adding packages very frequently to the desktop as i work and would like a simple way to make sure the same packages get installed on the laptop.
any help much appreciated
ps. not everything i'm installing is from CRAN...some are packages taken from github
If you have more than a couple of machine to maintain with the same R configuration, I think you should consider setting up your own local R repository.
And I will just redirect you to another SO question here:
Creating a local R package repository
You can also find the most useful information in the R manual.
Once this is done, you just have to update the local R repository and the packages will be updated on all machines, Windows or Unix
You can just copy and paste the folders in the R libraries between machines. As long as it is the same operating system on both machines there should not be any problem. If you want it to be automatically synchronised then place the R libraries into something like dropbox so that adding or updating a package will automatically appear on either machine with the next sync.

Resources