Consume a web service in R - r

Here's the scenario:
I have JBoss serving a web service with JBossWS providing me with a wsdl. I have connected and used it from both .NET and Java so far (and it has been quite easy once I figured it out). I am now trying to do the same with R.
Is there anything out there considered to be "the right way" for doing this? I am not that familiar with R, and my searches have not turned up much, so I figured I'd ask and maybe spare my head and the wall a bit of damage.

I have had good luck using rJava to recreate in R something that works in Java. I use this method for connecting to Amazon's AWS Java SDK for their API with R. This allows me, for example, to transfer files to/from S3 from R without having to recreate the whole connection/handshake/boogieWoogie from R.
If you wanted to go more "pure R" I think you'll have to use some combination of RCurl and the XML package to grab and parse the wsdl.

There are a number of ways:
You could retain your Java approach and use the rJava package around it
You could use RCurl which is used to power a few higher-level packages (accessing Google APIs, say)
I believe there is an older SSOAP package on Omegahat which may help too.

Related

Does the sf package in R use any online API?

I am trying to understand if the sf package in R operates at the local (desktop) level or if it uses API to transmit information online. The documentation mentions the use of API to pull in algorithms but it is unclear to me what that involves.
The package operates locally; once compiled it is perfectly capable of being run in firewalled contexts if that is your question.

Using R in Apache Spark

There are some options to access R libraries in Spark:
directly using sparkr
using language bindings like rpy2 or rscala
using standalone service like opencpu
It looks like SparkR is quite limited, OpenCPU requires keeping additional service and bindings can have stability issue. Is there something else specific to Spark architecture which make using any solution not easy.
Do you have any experience with integrating R and Spark you can share?
The main language for the project seems like an important factor.
If pyspark is a good way to use Spark for you (meaning that you are accessing Spark from Python) accessing R through rpy2 should not make much difference from using any other Python library with a C-extension.
There exist reports of users doing so (although with occasional questions such as How can I partition pyspark RDDs holding R functions or Can I connect an external (R) process to each pyspark worker during setup)
If R is your main language, helping the SparkR authors with feedback or contributions where you feel there are limitation would be way to go.
If your main language is Scala, rscala should be your first try.
While the combo pyspark + rpy2 would seem the most "established" (as in "uses the oldest and probably most-tried codebase"), this does not necessarily mean that it is the best solution (and young packages can evolve quickly). I'd assess first what is the preferred language for the project and try options from there.

Remote communication with R – How to start with an R GUI client to access R on a remote Server

I tried RInside's Qt example qdensity and really liked it. It was easy to setup and I was surprised how easy it was to understand and modify given that I have virtually no Qt experience. Now I wonder whether it is possible to use RInside with R somewhere on a remote machine.
It seems that I cannot use RInside for this purpose. I wonder whether there is another way of creating a Qt Desktop app, that communicates with R on some server. I got R Studio Server running and I am really happy with it, but it's for the R people. In order to promote my R stuff within our institute also among non-R people I would like to offer a simple, very limited GUI that can do basics things like showin' some graph or starting a R CMD Batch. I also know shiny (and shiny server) and have been actively testing it recently, but I am looking for a simple Desktop client go connect with my server-side R.
Is there a basis to start out with Rserve and Qt?
Any suggestions (where to start, examples, generally bad idea) ???
What are R's capabilities to handle something like this IPC or D-Bus stuff.
Use Qt with C++, and just process the files that you create with R on you're server.
So for example: create the graphic and save in a format that you can load. BMP, PNG etc. Load it to you're GUI.
Also I suggest Qt Creator for GUI design. Its fast and simple. This idea only fits you if you don't want to stay in in R environment.
When I have created programs that process data and calculate things like probabilities and charts, usually use HTML for the interface using PHP and leaving the rest of the processing (for example R scripts) to the server.
For any recent visitor: Take a look at openCPU, it publishes R functions as restful services and does all the marshalling from R data types from and to JSON.

R and Daily Projects

I'm now reading some books of R, but I want to know if I can use this language as I use Perl or Ruby. Things like:
Image Processing
File Compression
Use APIs
Interact With Internet
But it's usual and simple(as in Perl or Ruby) to do things like this?
PS: I liked this language very much, because of this I want to use it on my personal projects and spread it for my friends and at the internet.
The CRAN Task Views are reasonable starting points. So in order
Image processing: see Graphics and MedicalImaging
File compression: accessible from Base R, so try help(connection)
Use APIs: you will need to ask that question again, if you mean language bindings: yes, plenty, though no one single page for all
Interact with Internet: see above on help(connection), there are also packages that wrap curl, provide SOAP and of course the XML package.
Edit: And I forgot to stress that R as a statistical language and environment is more domain-specific than either Ruby or Python so the comparisons aren't entirely appropriate. But you can also code Gtk2 guis in R if you feel like it...

HTTP Libraries for Emacs

I recently discovered the org-mode in emacs and it works very well for me. I also like www.RememberTheMilk.com. I would like to be able to sync my org-mode file and RTM list. I know that RTM has its API exposed as web services. I am currently looking for a HTTP library that I could use to write my script. I found a couple of links but I am still not entirely satisfied.
http://www.koders.com/lisp/fidB46CCCA8D57FBD093BAF6E08289CFB4DA7624B2B.aspx?s=TV+Raman
http://www.emacswiki.org/cgi-bin/wiki/http-post-simple.el
Any pointers in doing web service interactions with emacs would be very useful. Also please keep in mind that I'm not a seasoned emacs expert. I have broken the initial barriers of emacs and can find my way around elisp. So, be gentle. :-)
Emacs ships with url.el and url-http.el. Although http-get.el, http-post.el and http-cookies.el are in vogue today. Here's the GitHub link where you can get it from.
http://github.com/wfarr/dotfiles/tree/master/.elisp
Any other suggestions are also welcome.
If I were to work on this, I'd use Pymacs to interface Emacs to Python and then use the existing Python API kit for Remember the Milk. Why re-implement all the HTTP crud yourself?

Resources