Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
gtrendsR查询的问题_R_Gtrendsr - Fatal编程技术网

gtrendsR查询的问题

gtrendsR查询的问题,r,gtrendsr,R,Gtrendsr,我在gTrendsR搜索中收到两个错误。我试图将该包与来自的CRAN下载和devel版本一起使用 这些表达式似乎并不依赖于搜索结果,而是依赖于查询本身。第二个错误源于: if (length(vec) < 2) { stop("Not enough search volume. Please change your search terms.", call. = FALSE) } 我也有同样的问题。出于某种原因,像下面这样更改我的代码很有帮助。希望你能找出原

我在
gTrendsR
搜索中收到两个错误。我试图将该包与来自的CRAN下载和devel版本一起使用

这些表达式似乎并不依赖于搜索结果,而是依赖于查询本身。第二个错误源于:

if (length(vec) < 2) {
    stop("Not enough search volume. Please change your search terms.",
         call. = FALSE)
  }

我也有同样的问题。出于某种原因,像下面这样更改我的代码很有帮助。希望你能找出原因。我是个笨蛋

> styles <- gtrends(query=c("Pixie Pant", "Yoga Pants", "Jeans"))
# Error in names(trend) <- make.names(paste(kw, geo)) : 
# 'names' attribute [3] must be the same length as the vector [2]
> commodities2 <- gtrends(c("Oil prices", "mortgage rates"), res="7d", geo= "US")
> styles <- gtrends(c("Pixie Pant", "Yoga Pants", "Jeans"))
# Error in names(trend) <- make.names(paste(kw, geo)) : 
#  'names' attribute [3] must be the same length as the vector [2]
> styles <- gtrends(c("Pixie Pant", "Yoga Pants", "Jeans"), res="7d", geo= "US")
> plot(styles)


devtools::install_github('PMassicotte/gtrendsR')

library(gtrendsR)
# do not need to log in anymore
# syntax change!
gt.us <- gtrends("USA", geo="US", time = "2004-01-01 2004-01-30")
devtools::install_github('PMassicotte/gtrendsR'))
图书馆(GTSR)
#不需要再登录了
#语法改变!

我们很有趣。我无法在运行于Windows 7 x64(build 7601)Service Pack 1、gtrendsR_1.3.1(…)下的平台为x86_64-w64-mingw32/x64(64位)的R版本3.2.2(2015-08-14)中重现错误
sessionInfo()
# R version 3.2.3 (2015-12-10)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 7 x64 (build 7601) Service Pack 1
# 
# locale:
#   [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
# [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
# [5] LC_TIME=English_United States.1252    
# 
# attached base packages:
#   [1] stats     graphics  grDevices utils     datasets  methods   base     
# 
# other attached packages:
#   [1] gtrendsR_1.3.3
# 
# loaded via a namespace (and not attached):
#   [1] zoo_1.7-12       colorspace_1.2-6 scales_0.4.0     googleVis_0.5.10 plyr_1.8.3      
# [6] tools_3.2.3      gtable_0.2.0     RCurl_1.95-4.8   Rcpp_0.12.3      ggplot2_2.1.0   
# [11] RJSONIO_1.3-0    grid_3.2.3       munsell_0.4.3    bitops_1.0-6     lattice_0.20-33
> styles <- gtrends(query=c("Pixie Pant", "Yoga Pants", "Jeans"))
# Error in names(trend) <- make.names(paste(kw, geo)) : 
# 'names' attribute [3] must be the same length as the vector [2]
> commodities2 <- gtrends(c("Oil prices", "mortgage rates"), res="7d", geo= "US")
> styles <- gtrends(c("Pixie Pant", "Yoga Pants", "Jeans"))
# Error in names(trend) <- make.names(paste(kw, geo)) : 
#  'names' attribute [3] must be the same length as the vector [2]
> styles <- gtrends(c("Pixie Pant", "Yoga Pants", "Jeans"), res="7d", geo= "US")
> plot(styles)
devtools::install_github('PMassicotte/gtrendsR')

library(gtrendsR)
# do not need to log in anymore
# syntax change!
gt.us <- gtrends("USA", geo="US", time = "2004-01-01 2004-01-30")