【发布时间】:2019-10-07 09:16:43
【问题描述】:
我从 R 查询植物列表网站 (http://www.theplantlist.org),但如果植物名称中有分音符号 (ë),这将不起作用。 通常,搜索植物物种名称,例如“Vaccinium acosta”,正确引导到 URL“http://www.theplantlist.org/tpl1.1/search?q=vaccinium+acosta”的单个物种页面(在 R 和 Firefox 中)。
如何使用 URL 中的物种名称(而不是 http://www.theplantlist.org/tpl1.1/record/tro-50262461 中的--unknown--record ID)查询“Vaccinium borneënse”的物种页面?这个网站有可能吗?
除其他外,我尝试了以下方法,但它们都指向越橘属(包含许多不同的物种)的概述页面:
http://www.theplantlist.org/tpl1.1/search?q=vaccinium+borneënse
http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borneense
http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borne%C3%ABnse
http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borneënse
最后,我想使用 read.csv 读取 R 中物种列表的特定物种页面:
read.csv("http://www.theplantlist.org/tpl1.1/search?q=vaccinium+acosta&csv=true")
【问题讨论】:
-
read.csv('http://www.theplantlist.org/tpl1.1/search?q=vaccinium+borneënse&csv=true')的数据有什么问题?它会给出不需要的行吗? -
是的,它给出了不需要的行,这是我使用它的较大函数中的一个问题。 Giacomo 的解决方案效果很好!