Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R interface to wolfram alpha [closed]

Tags:

r

wolframalpha

The wolfram alpha web interface suffers (like Mr. Wolfram) from massive hubris. There is some very useful data behind that interface; however, and I'd like to access it programmatically. There appears to be a python library to do this. Is anyone aware of an R package for wolfram alpha? How would I go start building it, if it does not exist?

like image 206
Zach Avatar asked Jul 11 '11 18:07

Zach


People also ask

How do I use Wolfram Alpha offline?

Can I access Wolfram|Alpha offline? No. Wolfram|Alpha is a web-based service that runs on a large centralized compute cluster.

How do you get API in Wolfram Alpha?

Obtaining an AppIDClick the Sign up to get your first AppID button to start the app creation process. After a one-time survey about intended usage, the AppID creation dialog will appear. Give your application a name and a simple description to register an AppID. Each application must have its own unique AppID.

Does Wolfram Alpha have an API?

The Wolfram|Alpha Full Results API provides a web-based API allowing the computational and presentation capabilities of Wolfram|Alpha to be integrated into web, mobile, desktop and enterprise applications.

What is the difference between Mathematica and Wolfram Alpha?

Mathematica was developed in 1988 while Wolfram Alpha is a more recent program. The key difference between Wolfram Alpha and Mathematica is that Wolfram Alpha operates online while Mathematica will need to be bought and installed as a software program.


2 Answers

In terms of putting together such a package yourself, there are a few pointers that might be helpful:

First is to check out the API for Wolfram Alpha: http://products.wolframalpha.com/api/

There you'll see the various URL calls that one can make and what the return formats would be.

Next, check out some packages that are doing similar things with other APIs. There are some examples at www.omegahat.org (particularly under the "REST-related packages" subsection, but there are others strewn about), as well as multiple packages on CRAN such as package "infochimps" by Drew Conway, RLastFM by Greg Hirson, as well as the "twitteR" and "RStackExchange" packages by me.

Looking at how these packages interact with their respective web APIs should get you started - it's a fairly straightforward process. The basic strategy is to build up the URL you need for a call w/ the parameters that you want and then to use R to send that to the server & retrieve the output (typically either in JSON or XML) and then parse that result back into an R object.

like image 190
geoffjentry Avatar answered Oct 04 '22 01:10

geoffjentry


Perhaps calling that package from R: http://rpython.r-forge.r-project.org/

like image 40
IRTFM Avatar answered Oct 04 '22 00:10

IRTFM