-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
69 lines (46 loc) · 1.63 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
69
---
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%"
)
```
# fishsizefunctions
<!-- badges: start -->
<!-- badges: end -->
The goal of fishsizefunctions is to download species photographic images from the Reef Life Survey website into R.
## Installation
You can install the development version of fishsizefunctions from [GitHub](https://github.com/) with:
```{r message = FALSE, warning=FALSE}
# install.packages("devtools")
devtools::install_github("fishsizeproject/fishsizefunctions")
```
## Example
A simple example, let's download an image of the species *Pseudocheilinus hexataenia*.
```{r example}
library(fishsizefunctions)
get_species_image("Pseudocheilinus hexataenia")
```
or you can load multiple images of the same species. In the below example, there are not 30 images on the Reef Life Survey website, therefore only the maximum number of available images in used.
```{r eval=FALSE}
get_species_image("Pseudocheilinus hexataenia", 1:30)
```
or you can include the images into a ggplot
```{r}
library(ggplot2)
my_img <- get_species_image("Pseudocheilinus hexataenia", 2)
ggplot() +
aes(x = 1:10,
y = 1:10) +
geom_point() +
{if(!is.null(my_img)) annotation_raster(my_img,
xmin = 1,
xmax = 3,
ymin = 8,
ymax = 10) }
```