-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
69 lines (51 loc) · 1.25 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# paisaje <img align="right" width="180" src="man/figures/paisaje_logo.png">
<!-- badges: start -->
<!-- badges: end -->
The goal of paisaje is to provide tools for landscape analysis.
## Installation
You can install the development version of paisaje from [GitHub](https://github.com/) with:
``` r
install.packages("devtools")
devtools::install_github("ManuelSpinola/paisaje")
```
## Example
This is a basic example which shows you how to use the package:
```{r}
#| message: false
#| warning: false
library(paisaje)
library(tidyverse)
library(sf)
library(h3jsr)
```
Let's bring an sf object
```{r}
#| message: false
#| warning: false
nc = st_read(system.file("shape/nc.shp", package="sf"))
```
Create an h3 grid of resolution 4
```{r}
#| message: false
#| warning: false
h3_grid_nc <- get_h3_grid(nc, resolution = 4)
```
Make a map
```{r}
ggplot() +
theme_minimal() +
geom_sf(data = nc, color = "blue", linewidth = 0.5) +
geom_sf(data = h3_grid_nc, alpha = 0.4, color = "coral", linewidth = 0.5)
```