Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/curycu/valuemap
Quick & easy visualization with sf polygons & data.frame with H3 address
https://github.com/curycu/valuemap
geospatial leaflet r sf
Last synced: about 2 months ago
JSON representation
Quick & easy visualization with sf polygons & data.frame with H3 address
- Host: GitHub
- URL: https://github.com/curycu/valuemap
- Owner: Curycu
- License: gpl-3.0
- Created: 2020-06-27T08:28:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-07T04:58:57.000Z (about 2 years ago)
- Last Synced: 2024-10-24T09:22:11.917Z (2 months ago)
- Topics: geospatial, leaflet, r, sf
- Language: R
- Homepage:
- Size: 11 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# valuemap
[![CRAN](https://www.r-pkg.org/badges/version/valuemap)](https://cran.r-project.org/package=valuemap)
[![Downloads](https://cranlogs.r-pkg.org/badges/grand-total/valuemap)](https://www.r-pkg.org/pkg/valuemap)The goal of valuemap is to save data analysts' efforts & time with pre-set sf polygon visualization.
You can also visualize with plain data.frame based on H3 addresses## Installation
To install the stable version from CRAN, simply run the following from an R console:
```{r, eval = FALSE}
install.packages('valuemap')
```To install the latest development builds directly from GitHub, run this instead:
```{r, eval = FALSE}
if (!require('remotes')) install.packages('remotes')
remotes::install_github('Curycu/valuemap')
```## How to Use?
**Your data must have two columns named as `name` & `value`**
- `name` column is used for mouse over popup information
- `value` column is used for mouse over popup information & color polygons & display center number of polygons
```{r}
library(valuemap)data('seoul')
seoul
```#### Example 1
##### Quick & easy visualization of sf polygons with value
```{r, eval = FALSE}
valuemap(seoul)
```
![](example_1.PNG)#### Example 2
##### Emphasize greater or equal to 20 polygons (>= 20, < 20 : two level only)
```{r, eval = FALSE}
valuemap(seoul, legend.cut=c(20))
```
![](example_2.PNG)#### Example 3
##### Visualize without center number on polygons
```{r, eval = FALSE}
valuemap(seoul, legend.cut=c(15,17,20), show.text=FALSE)
```
![](example_3.PNG)#### Example 4
##### Change color palette & center number on polygons text color, format & change background map
```{r, eval = FALSE}
valuemap(
seoul, map=leaflet::providers$Stamen.Toner, palette='YlOrRd',
text.color='blue', text.format=function(x) paste(x,'EA')
)
```
![](example_4.PNG)
#### Example 5
##### You can visualize based on plain data.frame with h3 address
```{r}
data('seoul_h3')
seoul_h3
```
```{r, eval = FALSE}
valuemap_h3(seoul_h3, legend.cut=1:6, show.text=FALSE)
```
![](example_5.PNG)