r - Google 趋势函数中未使用的参数 (R)
问题描述
我正在尝试检索 Google 趋势查询,但出现以下错误:
Error in gtrends(keyword = "hotel zypern", geo = "DE", time = "2004-01-01 2016-04-30", :
unused argument (alist())
我用 R 编写的代码:
ger1<-gtrends(
keyword = "hotel zypern",
geo = "DE",
time ="2004-01-01 2016-04-30",
gprop = c("web", "news", "images", "froogle", "youtube"),
category = "0",
hl = "de",
low_search_volume = FALSE,
cookie_url = "http://trends.google.com/Cookies/NID",
tz = "Europe/Berlin",
onlyInterest = "FALSE",
)
我已尝试按照其他帖子的建议包含“...”,并修改了函数的参数,但我没有找到任何应该包含这样一个参数的地方。
先感谢您!!
解决方案
你最后多了一个逗号。加:它必须是:(onlyInterest = FALSE
没有分号,它不是字符串,而是布尔值):
ger1<-gtrends(
keyword = "hotel zypern",
geo = "DE",
time ="2004-01-01 2016-04-30",
gprop = c("web", "news", "images", "froogle", "youtube"),
category = "0",
hl = "de",
low_search_volume = FALSE,
cookie_url = "http://trends.google.com/Cookies/NID",
tz = "Europe/Berlin",
onlyInterest = FALSE
)
我收到了一个警告,但它有效。如果您想避免这种情况,请尝试设置您的 sys.setenv:
Sys.setenv(TZ="Europe/Berlin")
就像这里建议的那样: R strptime/as.POSIXct 中的未知时区名称
推荐阅读
- c# - 编写构造函数来初始化属性 csharp?
- video - 视频静音时,MediaRecorder 在 Chrome 中给出 0 个字节
- javascript - Web API 是否在其他线程中运行?
- hive - Impala/Hive 函数获取字符串的子字符串
- html - 将数据传递给 Blazor 中的模式
- java - 在构建 Maven Web 应用程序时创建一个 zip 文件并将该文件移动到生成的 .war 文件
- reactjs - 错误:对象作为 React 子项无效。如果您打算渲染一组子项,请使用数组而不是使用 Reactjs
- python - Telegram API 偶尔会在请求中抛出与 SSL 相关的异常
- graphql - Gatsby:如何列出所有节点?
- machine-learning - 不平衡数据的多标签分层拆分