Skip to content

Commit c5a77d3

Browse files
committed
Add README
1 parent c48fd1f commit c5a77d3

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
^README\.Rmd$
12
^cran-comments\.md$
23
^.*\.Rproj$
34
^\.Rproj\.user$

README.Rmd

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
output: github_document
3+
---
4+
5+
<!-- README.md is generated from README.Rmd. Please edit that file -->
6+
7+
```{r setup, include = FALSE}
8+
knitr::opts_chunk$set(
9+
collapse = TRUE,
10+
comment = "#>",
11+
fig.path = "man/figures/README-",
12+
out.width = "100%"
13+
)
14+
```
15+
# leaflet.opacity
16+
17+
# General
18+
19+
**leaflet.opacity** extends the **leaflet** R package with the **Leaflet.OpacityControls** JavaScript plugin (LizardTech, 2013). It offers control buttons and a slider for adjusting the opacity of a layer.
20+
21+
## Installation
22+
23+
You can install the released version of leaflet.opacity from [CRAN](https://CRAN.R-project.org) with:
24+
25+
```{r, eval=FALSE}
26+
install.packages("leaflet.opacity")
27+
```
28+
29+
or the latest version from GitHub with:
30+
31+
```{r, eval=FALSE}
32+
devtools::install_github("https://github.com/be-marc/leaflet.opacity", dependencies=TRUE)
33+
```
34+
35+
## Example
36+
37+
```{r, eval=FALSE}
38+
library(leaflet)
39+
library(leaflet.opacity)
40+
library(raster)
41+
42+
r <- raster(xmn = -2.8, xmx = -2.79, ymn = 54.04, ymx = 54.05, nrows = 30, ncols = 30)
43+
values(r) <- matrix(1:900, nrow(r), ncol(r), byrow = TRUE)
44+
crs(r) <- CRS("+init=epsg:4326")
45+
46+
leaflet() %>%
47+
addTiles() %>%
48+
addRasterImage(r, layerId = "raster") %>%
49+
addOpacitySlider(layerId = "raster")
50+
```
51+
52+
## Reference
53+
54+
LizardTech (2013). Leaflet.OpacityControls. Retrieved from https://github.com/lizardtechblog/Leaflet.OpacityControls
55+

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
<!-- README.md is generated from README.Rmd. Please edit that file -->
3+
4+
# leaflet.opacity
5+
6+
# General
7+
8+
**leaflet.opacity** extends the **leaflet** R package with the
9+
**Leaflet.OpacityControls** JavaScript plugin (LizardTech, 2013). It
10+
offers control buttons and a slider for adjusting the opacity of a
11+
layer.
12+
13+
## Installation
14+
15+
You can install the released version of leaflet.opacity from
16+
[CRAN](https://CRAN.R-project.org) with:
17+
18+
``` r
19+
install.packages("leaflet.opacity")
20+
```
21+
22+
or the latest version from GitHub
23+
with:
24+
25+
``` r
26+
devtools::install_github("https://github.com/be-marc/leaflet.opacity", dependencies=TRUE)
27+
```
28+
29+
## Example
30+
31+
``` r
32+
library(leaflet)
33+
library(leaflet.opacity)
34+
library(raster)
35+
36+
r <- raster(xmn = -2.8, xmx = -2.79, ymn = 54.04, ymx = 54.05, nrows = 30, ncols = 30)
37+
values(r) <- matrix(1:900, nrow(r), ncol(r), byrow = TRUE)
38+
crs(r) <- CRS("+init=epsg:4326")
39+
40+
leaflet() %>%
41+
addTiles() %>%
42+
addRasterImage(r, layerId = "raster") %>%
43+
addOpacitySlider(layerId = "raster")
44+
```
45+
46+
## Reference
47+
48+
LizardTech (2013). Leaflet.OpacityControls. Retrieved from
49+
<https://github.com/lizardtechblog/Leaflet.OpacityControls>

0 commit comments

Comments
 (0)