简体   繁体   English

R 到 wolfram alpha 的接口

[英]R interface to wolfram alpha

The wolfram alpha web interface suffers (like Mr. Wolfram) from massive hubris . wolfram alpha web 接口(像 Wolfram 先生一样)遭受巨大的狂妄自大 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.似乎有一个python 库可以执行此操作。 Is anyone aware of an R package for wolfram alpha?有人知道 wolfram alpha 的 R package 吗? How would I go start building it, if it does not exist?如果 go 不存在,我将如何开始构建它?

In terms of putting together such a package yourself, there are a few pointers that might be helpful:就自己组装这样的 package 而言,有一些建议可能会有所帮助:

First is to check out the API for Wolfram Alpha: http://products.wolframalpha.com/api/首先是查看 Wolfram Alpha 的 API: http://products.wolframalpha.com/api/

There you'll see the various URL calls that one can make and what the return formats would be.在那里,您将看到可以进行的各种 URL 调用以及返回格式。

Next, check out some packages that are doing similar things with other APIs.接下来,查看一些与其他 API 做类似事情的包。 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. www.omegahat.org 上有一些示例(特别是在“REST-related packages”小节下,但还有其他一些),以及 CRAN 上的多个包,例如 Drew Conway 的 package “infochimps”,Greg 的 RLastFM Hirson,以及我的“twitteR”和“RStackExchange”包。

Looking at how these packages interact with their respective web APIs should get you started - it's a fairly straightforward process.查看这些包如何与它们各自的 web API 交互应该可以帮助您入门 - 这是一个相当简单的过程。 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. 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进入 R object。

Perhaps calling that package from R: http://rpython.r-forge.r-project.org/也许从 R 调用 package: http://rpython.r-forge.r-project.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM