gchartsmap
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.3%) to scientific vocabulary
Last synced: 9 months ago
·
JSON representation
Repository
Basic Info
- Host: GitHub
- Owner: odeleongt
- Language: R
- Default Branch: main
- Size: 187 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
- Releases: 1
Created about 1 year ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
README.Rmd
---
output: github_document
editor_options:
chunk_output_type: console
---
```{r}
#| echo: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# gchartsmap: Access 'Google Charts' Map Data
[](https://github.com/odeleongt/gchartsmap/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/odeleongt/gchartsmap)
## Overview
This package connects to the 'Google Charts' geographic data resources, allowing
the user to download contents to use as a reference for related services like
'Google Trends'.
## Installation
Install the package from CRAN using:
```{r eval=FALSE}
install.packages("gchartsmap")
```
Install the development version from GitHub using:
```{r eval=FALSE}
remotes::install_github("odeleongt/gchartsmap")
```
## Usage
You will need Internet access to download data from the Google Charts static
content servers.
There is some documentation for developers using Google Charts at
, but no
information is provided on how to access the data directly.
Geographic information for regions at the sub-national level can be accessed
using the country codes listed in the Google Charts documentation, with some
suffix that is tracked in this package.
There is an additional level of data for the US that documents groups of counties,
and is used by services such as [Google Trends](https://trends.google.com/trends/),
but no documentation is provided for this.
Those files are accessed with an integer, and this package attempts to grab each
area by trying with numbers `1:1000` by default.
```{r}
#| label: setup
#| eval: FALSE
library(package = "gchartsmap")
library(package = "sf")
# use the default, or set your own cache path
gchart_set_cache("your/preferred/cache/path")
```
```{r}
#| echo: false
library(package = "gchartsmap")
library(package = "sf")
gchart_set_cache(tempdir())
```
A cache is needed, as we want to avoid constantly fetching files from the Google
static servers.
```{r results='hide'}
# check out a list of all country codes
all_countries <- gchart_countries()
# get data for the US
us <- gchart_generate_countries("US")
# check out some US areas
some_areas <- c(
503L, 507L, 520L, 522L, 524L, 525L, 530L, 561L, 567L, 575L,
606L, 630L, 656L, 691L
)
areas <- gchart_generate_us_areas(some_areas)
# make a simple map of Georgia, US
plot( sf::st_geometry(us[us$id == "US-GA",]), lwd = 3, border = "blue")
# draw the underlying areas
plot(areas[, "id"], axes = TRUE)
plot(sf::st_geometry(us[us$id == "US-GA",]), add = TRUE, lwd = 3, border = "blue")
```
These geographic data are only intended for simple presentation. As Google does
not provide documentation on the coordinate reference system, don't expect the
data to align to real world features without processing that is out of the scope
of this package.
In the plot above, you can notice some misalignment between the state border and
the smaller areas.
Owner
- Name: Oscar
- Login: odeleongt
- Kind: user
- Repositories: 58
- Profile: https://github.com/odeleongt
GitHub Events
Total
- Create event: 2
- Release event: 1
- Issues event: 1
- Push event: 8
Last Year
- Create event: 2
- Release event: 1
- Issues event: 1
- Push event: 8
Packages
- Total packages: 1
-
Total downloads:
- cran 221 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 3
- Total maintainers: 1
cran.r-project.org: gchartsmap
Access 'Google Charts' Map Data
- Homepage: https://github.com/odeleongt/gchartsmap
- Documentation: http://cran.r-project.org/web/packages/gchartsmap/gchartsmap.pdf
- License: GPL-3
-
Latest release: 1.0.1
published 11 months ago
Rankings
Dependent packages count: 26.4%
Dependent repos count: 32.5%
Average: 48.5%
Downloads: 86.6%
Maintainers (1)
Last synced:
10 months ago
Dependencies
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v4 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION
cran
- R >= 4.1.0 depends
- httr * imports
- jsonlite * imports
- sf * imports
- tigris * imports
- testthat >= 3.0.0 suggests