RISmed 包错误:无法打开连接 [英] RISmed package error: cannot open the connection

查看:113
本文介绍了RISmed 包错误:无法打开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 RISmed 包从 PubMed 科学数据库中提取数据.我以前使用过完全相同的程序,但现在我无法让它工作.下面的示例是一个玩具示例.

<块引用><块引用>

图书馆(RISmed)

res <- EUtilsSummary("pinkeye", type="esearch", db="pubmed", datetype='pdat', mindate=2000, maxdate=2015, retmax=500)

文件错误(con,r"):无法打开连接

<块引用>

QueryCount(res)

QueryCount(res) 中的错误:找不到对象res"

'QueryCount(res)' 应该返回使用查询找到的命中数,但由于它没有找到连接,所以没有找到任何命中.

我已检查如果 R 有互联网连接并且看起来确实如此;我的 mac 似乎也没有任何问题.有没有其他人也收到这个错误?你知道怎么解决吗?

非常感谢您的帮助!

解决方案

您可以在代码中添加类似 Sys.sleep(0.1) 的一行,在发送下一个搜索请求之前暂停 0.1s.它对我有用.

I'm trying to use the RISmed package to extract data from the PubMed scientific database. I have used the exact same procedure before, but now I can't get it to work. The example below is a toy example.

library(RISmed)

res <- EUtilsSummary("pinkeye", type="esearch", db="pubmed", datetype='pdat', mindate=2000, maxdate=2015, retmax=500)

Error in file(con, "r") : cannot open the connection

QueryCount(res)

Error in QueryCount(res) : object 'res' not found

The 'QueryCount(res)' is supposed to return the number of hits found using the query, but since it didn't find a connection, it didn't find any hits.

I have checked if R has an internet connection and it seems like it does ; my mac also doesn't seem to have any issues. Does anyone else get this error, too? Do you know how to solve it?

Help is greatly appreciated!

解决方案

You could add one line like Sys.sleep(0.1) in your code to pause 0.1s before sending the next request of searching. It worked for me.

这篇关于RISmed 包错误:无法打开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆