googletrend icon indicating copy to clipboard operation
googletrend copied to clipboard

simple = TRUE not working

Open barbosa903 opened this issue 11 years ago • 3 comments

Hi,

First of all thanks for the package. The problem is I cannot avoid the extra data that comes with simple ON. Doenst matter if I put simple = TRUE or simple = FALSE, I always get the same result. I am currently using windows 7 home, RStudio

barbosa903 avatar Jan 19 '15 22:01 barbosa903

str() function is also giving me a weird result. It identifies only 2 variables ( i.e. $trend and $week), but the correct result should show me $topsearch, $index, $region, etc

x <- gettrend(keyword = 'dummy', simple=FALSE)

str(x) List of 1 $ trend:'data.frame': 723 obs. of 2 variables: ..$ week : Date[1:723], format: "2004-01-04" "2004-01-11" "2004-01-18" "2004-01-25" ... ..$ index: num [1:723] 76 82 76 72 89 81 87 85 80 76 ...

barbosa903 avatar Jan 19 '15 22:01 barbosa903

changing simple = TRUE to simple = FALSE yields a very similar result

x <- gettrend(keyword = 'dummy', simple=TRUE)

str(x) 'data.frame': 723 obs. of 2 variables: $ week : Date, format: "2004-01-04" "2004-01-11" "2004-01-18" "2004-01-25" ... $ index: num 76 82 76 72 89 81 87 85 80 76 ...

barbosa903 avatar Jan 19 '15 22:01 barbosa903

I've found a similar issue as well, except it only occurs when I define a category value. For a default query, it appears to be working fine:

x <- gettrend(keyword = 'dummy', simple=FALSE)

'List of 4
 $ trend     :'data.frame': 591 obs. of  2 variables:
  ..$ week : Date[1:591], format: "2004-01-04" "2004-01-11" "2004-01-18" "2004-01-25" ...
  ..$ index: num [1:591] 75 75 88 65 81 84 91 77 82 85 ...
 $ top.region:'data.frame': 62 obs. of  2 variables:
  ..$ region: chr [1:62] "United Kingdom" "Australia" "Singapore" "New Zealand" ...
  ..$ index : num [1:62] 100 89 73 69 63 59 55 55 52 51 ...
 $ top.city  :'data.frame': 15 obs. of  2 variables:
  ..$ region: chr [1:15] "London (United Kingdom)" "Melbourne (Australia)" "Manchester (United Kingdom)" "Sydney (Australia)" ...
  ..$ index : num [1:15] 100 92 92 92 90 80 69 58 56 56 ...
 $ top.search:'data.frame': 49 obs. of  2 variables:
  ..$ top.search: chr [1:49] "dummy never fails" "dummy text" "dummy test" "baby dummy" ...
  ..$ index     : num [1:49] 60 45 40 35 35 35 30 30 25 25 ...

x <- gettrend(keyword = 'dummy', simple=FALSE, category='0-44')

List of 1
 $ trend:'data.frame':  591 obs. of  2 variables:
  ..$ week : Date[1:591], format: "2004-01-04" "2004-01-11" "2004-01-18" "2004-01-25" ...
  ..$ index: num [1:591] 0 0 0 0 0 0 0 0 0 0 ...

It's not a huge problem, but I'd be really interested in the top queries for related terms in the categories.

Just figured you should know. Thanks again for the package, it's excellent work.

Vvkmnn avatar Apr 27 '15 17:04 Vvkmnn