-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tidy? #110
Comments
Oh, gosh, I had to squint hard to get at what you wanted here as R> library(gtrendsR)
Creating a generic function for ‘toJSON’ from package ‘jsonlite’ in package ‘googleVis’
R> res <- gtrends("nhl", geo = "CA")
R> head(res$trend)
start end nhl.CA
1 2004-01-04 2004-01-10 21
2 2004-01-11 2004-01-17 21
3 2004-01-18 2004-01-24 22
4 2004-01-25 2004-01-31 20
5 2004-02-01 2004-02-07 21
6 2004-02-08 2004-02-14 21
R> class(res$trend)
[1] "data.frame" wasn't quite sure what you suggested. In short, "could do" -- but what about more complex queries like the recent 'cloud and big data'. At some point it gets silly to repeat this. A more compact form would be to set an attribute via So I don't really see yet why we need to stick it into the data.frame. Maybe add as an example, or maybe add a helper function |
The only thing that "bug" me is BTW, just google made some changes and we can now download CSV by chuck. |
Gotcha. In that case ... shall we just override that with maybe a fixed word Download by chunk ... is better for really large result sets? |
Alright, I will work on that (the tidy thing). I will make more sens for request list this: > head(gtrends("蘋果",geo="TW")$trend)
start end X.e8..98..8b..e6..9e..9c..TW
1 2004-01-04 2004-01-10 20
2 2004-01-11 2004-01-17 21
3 2004-01-18 2004-01-24 22
4 2004-01-25 2004-01-31 17
5 2004-02-01 2004-02-07 19
6 2004-02-08 2004-02-14 26 |
Absolutely! I like 'hits' as a column number, and a 'long-to-wide' exporter helper may be useful. But this grumpy old man doesn't fall for every seasonal flavour of the tidyverse so just get off my lawn... |
Hehehe do not fear my friend, I did it like this: trend <- reshape(
trend,
varying = tmp_kw,
v.names = "hits",
direction = "long",
timevar = "keyword",
times = requested_kw
) |
No school like the old school. Using |
Should we reformat the output as this?
The text was updated successfully, but these errors were encountered: