Package 'sgat'

Title: Extract Information from Google's "Popular Times"
Description: Once you've identified a real life place, such as a shop, a restaurant, a bar, etc. use this package to simulate a Google search and retrieve its "Popular Times" and geographic location information and save them in Comma-Separated Values files. This package also downloads a list of restaurants and bars of Ushuaia city, Argentina.
Authors: Matias Poullain [aut, cre]
Maintainer: Matias Poullain <[email protected]>
License: MIT + file LICENSE
Version: 0.91
Built: 2025-01-24 03:39:42 UTC
Source: https://github.com/matiaspoullain/sgat

Help Index


Countries codes decodification

Description

A data frame containing all posibles countries codes to be used in mobility_var and their respective countries names diamonds.

Usage

countries_codes

Format

A data frame with 136 rows and 2 columns:

country.code

Countries codes to be used in mobility_var

country.region

Names of the countries or regions

Source

https://www.google.com/covid19/mobility/


Automated server creation

Description

Automated server creation

Usage

initialization_sgat()

Value

"Driver connection"

Examples

## Not run: 
initialization_sgat()

## End(Not run)

Download mobility variation data from one or many countries

Description

Download mobility variation data from one or many countries

Usage

mobility_var(country.code)

Arguments

country.code

Character class country code, vector of countries codes or "All". Countries codes can be found in "countries.codes". If "All", data from all countries will be downloaded

Value

Data frame with information of the mobility variations grouped by country, sub-region, date and type of activity

Examples

## Not run: 
argentina <- mobility_var("AR")
head(argentina)

northAmerica <- mobility_var(c("CA", "US", "MX"))
head(northAmerica)

allCountries <- mobility_var("All")
head(allCountries)

## End(Not run)

Iteration over sgat_day on every day of the week and finally save the retrieved data as a csv file. If you are looking for the "Popular Times" information for a single weekday use sgat_day instead.

Description

Iteration over sgat_day on every day of the week and finally save the retrieved data as a csv file. If you are looking for the "Popular Times" information for a single weekday use sgat_day instead.

Usage

sgat(lugar.a.buscar, tiempo.espera = 10, carpeta.guardado = NULL)

Arguments

lugar.a.buscar

What you want to search in Google

tiempo.espera

Time measure of how much time you think it's sufficient given your internet connection to load a Google search page and not finding the information,

carpeta.guardado

Name of the directory where the csv files will be saved. If the directory doesn't exist, it will be created automatically.

Value

Data frame with retrieved information for all weekdays

Examples

## Not run: 
museo <- sgat(lugar.a.buscar = "museo nacional de bellas artes, buenos aires, argentina")
head(museo)

## End(Not run)

Opens firefox, searches in Google lugar.a.buscar place on the dia.semana weekday. Then it retrieves the "Popular Times" and geolocation information. If the search finds said information, the function returns a data.frame, if not, NULL. If you are looking the "Popular Times" information for the whole week use sgat instead.

Description

Opens firefox, searches in Google lugar.a.buscar place on the dia.semana weekday. Then it retrieves the "Popular Times" and geolocation information. If the search finds said information, the function returns a data.frame, if not, NULL. If you are looking the "Popular Times" information for the whole week use sgat instead.

Usage

sgat_day(lugar.a.buscar, dia.semana, tiempo.espera = 10)

Arguments

lugar.a.buscar

What you want to search in Google

dia.semana

Day of the week from when you want to retrieve the "Popular Times" information

tiempo.espera

Time measure of how much time you think it's sufficient given your internet connection to load a Google search page and not finding the information,

Value

dataframe with retrieved information for single weekday

Examples

## Not run: 
museo.miercoles <- sgat_day("museo nacional de bellas artes, buenos aires, argentina", "miercoles")
head(museo.miercoles)

## End(Not run)

Search for the n most popular places in a city according to Tripadvisor

Description

Search for the n most popular places in a city according to Tripadvisor

Usage

tripadvisor_places(ciudad, n.resultados = Inf)

Arguments

ciudad

City or area where you want the places' information

n.resultados

Maximum number of results to retrieve. If not specified, all results will be retrieved

Value

Character vector with the names of the most popular places of the searched city or area according to Tripadvisor

Examples

## Not run: 
tripadvisor_places("Pinamar, Argentina", 10)

## End(Not run)

Retrieves a vector of Ushuaian's restaurants and bar's names and adresses, ready for unambiguous Google searches.

Description

Retrieves a vector of Ushuaian's restaurants and bar's names and adresses, ready for unambiguous Google searches.

Usage

ushuaia_restaurants()

Value

Vector of restaurants and bars in Ushuaia city, Tierra del Fuego, Argentina

Examples

restaurants <- ushuaia_restaurants()
head(restaurants)