问题标签 [ropensci]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
r - PubMed XML parsing using entrez_fetch in rentrez
I am collecting author's information and article information for a search term in PubMed. I am getting author name, publication year and other information successfully using entrez_fetch
in rentrez
package. Following is my example code:
Despite getting all the information I needed, I am having an issue in figuring out which authors are for which PMID. It is because length of authors are different for each PMID. For example, if I parsed author information for 100 articles as in my code, I get more than 100 authors name and I can not associate it with respective PMID. Overall, I would like to have an output data frame like this:
So this way, I would know which are authors are associated with which PMID and it useful for further analysis.
Just for the note, this is a small example of my code. I am collecting more information using XML
parsing via entrez_fetch
in rentrez
package.
This problem is really bugging me and I would really appreciate any help or guidance. Thank you for your efforts and help in advance.
r - 使用rentrez在R中解析XML文件
我不是XML
专家。XML
使用 . 解析文件时遇到问题rentrez
。我试图将每个 pmid(PubMed 数据库中的文章 ID)的作者和隶属关系作为输出。我的代码运行良好,除非作者有多个从属关系。当作者有多个从属关系时,列的长度first_names
、、 last_names
和affiliation
变得不同,它会返回错误。我真的没有 xml 解析方面的专业知识来处理这个问题。我严格期待如下结果:
entrez_fetch 返回的示例 XML 文件的结构如下:
以下是我正在使用的代码,它运行良好,除非 PubMed 数据库中一篇文章的作者有多个隶属关系:
非常感谢任何帮助和支持。
r - 如何下载geojson数据并将其读取到R
上面的代码是从https://rstudio.github.io/leaflet/choropleths.html复制而来的。
我正在尝试重现输出。但是,我陷入了第一步 - 下载 geojson 文件。我使用了第一行中显示的链接,并将其保存为文本文件,然后将其重命名为 geojson 文件。但我没能读到那个文件。文件下载或加载到 R 显然有问题,但我不知道它在哪里。
有人可以给出任何指示吗?我以前从未处理过 geojson 数据。我只需要前两行代码的帮助,我可以自己处理所有其他代码。
r - 如何在 R 中下载纽约州所有县数据以获取传单地图
上面的代码是从https://rstudio.github.io/leaflet/json.html复制过来的。
我知道如何根据代码中的要求下载纽约州县数据。(或者换句话说,如何生成 nycounties.geojson 文件)
我在前两条评论中浏览了这两个网站,但未能从美国的整个数据中对纽约州的数据进行子集化。
r - r无法使用ropenscilabs矿工包连接到Spigot服务器
我想尝试 ROpenSci 的矿工Minecraft API,但无法从 R 连接到服务器。我确信这是网络问题,而不是 R 或 Minecraft 问题,但我在这方面没有任何经验.
我已经按照这些说明在我的Arch机器上安装了小插曲,并且可以成功启动服务器并使用 Minecraft 客户端连接到它。
但是,当我尝试通过 RI 连接时,却无法这样做。这就是我得到的:
我还尝试了“localhost”并添加了 server-ip=127.0.0.1
这看起来很有趣,所以弄清楚我做错了什么会很酷。
如果有帮助,这是我的 server.properties 文件:
r - automate input to user query in R
I apologize if this question has been asked with terminology I don't recognize but it doesn't appear to be.
I am using the function comm2sci
in the library taxize
to search for the scientific names for a database of over 120,000 rows of common names. Here is a subset of 10:
When searching with the NCBI database in this function, it asks for user input if the common name is generic/general and not species specific, for example the following call will ask for clarification for "AARDVARK" by entering '1', '2' or 'return' for 'NA'.
Because of this, I cannot rely on this function to find the names of the 120000 species without me sitting and entering 'return' every few minutes. I know this question sounds taxize
specific - but I've had this situation in the past with other functions as well. My question is: is there a general way to place the comm2sci
call in a conditional statement that will return a specific value when user input is prompted? Or otherwise write a function that will return some input when prompted?
All searches related to this tell me how to ask for user input but not how to override user queries. These are two of the question threads I've found, but I can't seem to apply them to my situation: Make R wait for console input?, Switch R script from non-interactive to interactive
I hope this was clear. Thank you very much for your time!
r - 在 renderPlotly 单击事件中使用 nearPoints 时出现闪亮错误
我想nearPoints
使用点击事件中的数据来获取。
我从Shiny 网页中找到了以下代码段,它按预期工作得很好。
我试图模仿上述方法来nearPoints
使用点击事件数据识别 Plotly 图中的 。但是,它没有用。
关于如何将坐标信息传递给情节图的任何想法?