--- title: "sgat" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{sgat} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) ``` # sgat The goal of sgat package is to retrieve information from Google's searches' "Popular Times" and geolocation. ## Installation You can install the released version of sgat package from [CRAN](https://CRAN.R-project.org) with: ``` r install.packages("sgat") ``` And the development version from [GitHub](https://github.com/) with: ``` r # install.packages("devtools") devtools::install_github("matiaspoullain/sgat") ``` ## Example Once you've download the information, you can use it to compare the most popular hours in the week between places and their relative positions. Here is an example of its use in two cities in Argentina: https://matiaspoullain.shinyapps.io/Concurrencias_movilidad/ All that information was recolected using the following code: *Popular times for Pinamar ```{r example pinamar, echo = TRUE, eval = FALSE, message=FALSE, warning=FALSE} library(sgat) initialization_sgat() rest.pinamar <- restaurantes_general("Pinamar, argentina") rest.pinamar <- paste(rest.pinamar, ", Pinamar, Argentina", sep = "") for(i in rest.pinamar){ sgat(i, tiempo.espera = 20, carpeta.guardado = "Pinamar") } ``` *Popular times for Ushuaia ```{r example Ushuaia, echo = TRUE, eval = FALSE, message=FALSE, warning=FALSE} library(sgat) initialization_sgat() rest.Ushuaia <- restaurantes_general("Ushuaia, argentina") rest.Ushuaia <- paste(rest.Ushuaia, ", Ushuaia, Argentina", sep = "") for(i in rest.Ushuaia){ sgat(i, tiempo.espera = 20, carpeta.guardado = "Ushuaia") } ``` Mobility information was also recolected for Argentina: ```{r example mobilityr, echo = TRUE, eval = FALSE, message=FALSE, warning=FALSE} library(sgat) initialization_sgat() argentina <- mobility_var("AR") ```