Date formatting for Gtrends (gtrendsR package)

4

How do I resolve this formatting error in the gtrendsR package (actually how do I check the current native formatting and adjust it)?

Error in as.POSIXlt.character(x, tz, ...) : 
character string is not in a standard unambiguous format

i.e: The results of my session.

{> Sys.time()
[1] "2017-01-21 20:47:54 BRST"
> sessionInfo()
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C 
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] gtrendsR_1.3.5 rugarch_1.3-6 Rcpp_0.12.9
loaded via a namespace (and not attached):
[1] multicool_0.1-10 zoo_1.7-14 ks_1.10.4 
[4] lattice_0.20-33 colorspace_1.2-6 expm_0.999-0 
[7] SkewHyperbolic_0.3-2 XML_3.98-1.5 nloptr_1.0.4 
[10] selectr_0.3-0 plyr_1.8.3 stringr_1.0.0 
[13] munsell_0.4.3 gtable_0.2.0 rvest_0.3.2 
[16] mvtnorm_1.0-5 codetools_0.2-14 labeling_0.3 
[19] misc3d_0.8-4 curl_0.9.7 xts_0.9-7 
[22] KernSmooth_2.23-15 scales_0.4.1 DistributionUtils_0.5-1 
[25] jsonlite_0.9.20 truncnorm_1.0-7 googleVis_0.6.2 
[28] spd_2.0-1 digest_0.6.9 ggplot2_2.2.1 
[31] stringi_1.0-1 numDeriv_2016.8-1 grid_3.3.0 
[34] tools_3.3.0 magrittr_1.5 rgl_0.95.1441 
[37] lazyeval_0.2.0 Rsolnp_1.16 tibble_1.1 
[40] GeneralizedHyperbolic_0.8-1 Matrix_1.2-6 xml2_1.0.0 
[43] assertthat_0.1 httr_1.2.1 R6_2.1.2}
    
asked by anonymous 22.01.2017 / 01:27

1 answer

3

This is a bug in the gtrendsR package: link

It was already for them to have corrected this for some time. Well, while this does not happen, a partial solution is to run:

Sys.setenv(TZ="UTC") 

before you do your research.

    
22.01.2017 / 20:53