-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
85 lines (59 loc) · 2.89 KB
/
README.Rmd
File metadata and controls
85 lines (59 loc) · 2.89 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
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%"
)
```
# paar <a href="https://ppaccioretti.github.io/paar/"><img src="man/figures/logo.png" align="right" height="139" alt="paar website" /></a>
<!-- badges: start -->
[](https://github.com/PPaccioretti/paar/actions)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/PPaccioretti/paar/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of `paar` is to provide useful tools for cleaning and processing spatial data in precision agriculture.
## Installation
You can install the released version of paar from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("paar")
```
You can install the development version from [GitHub](https://github.com/PPaccioretti/paar) with:
``` r
# install.packages("pak")
pak::pkg_install("PPaccioretti/paar")
```
## Example
The package provides a complete protocol for automated error removal.
Default values of all functions are optimized for precision agriculture data.
```{r example, message=FALSE}
library(paar)
library(sf)
data("barley", package = 'paar')
```
The `barley` dataset contains grain yield data collected were using calibrated commercial yield monitors, mounted on combines equipped with DGPS.
```{r barley}
#Convert barley data to an spatial object
barley_sf <- st_as_sf(barley, coords = c("X", "Y"), crs = 32720)
barley_dep <-
depurate(barley_sf, "Yield")
# Summary of depurated data
summary(barley_dep)
```
Spatial yield values before and after the depuration process can be visualized
```{r, fig.height=2, fig.height=5, out.width="50%", fig.show="hold"}
plot(barley_sf["Yield"], main = "Before depuration")
plot(barley_dep$depurated_data["Yield"], main = "After depuration")
```
The distribution of yield values can also be compared
```{r, fig.height=2, fig.height=5, out.width="50%", fig.show="hold"}
boxplot(barley_sf[["Yield"]], main = "Before depuration")
boxplot(barley_dep$depurated_data[["Yield"]], main = "After depuration")
```
## References
- Vega, A., Córdoba, M., Castro-Franco, M. et al. (2019). Protocol for automating error removal from yield maps. Precision Agric 20, 1030–1044 https://doi.org/10.1007/s11119-018-09632-8
- Paccioretti, P., Córdoba, M., & Balzarini, M. (2020). FastMapping: Software to create field maps and identify management zones in precision agriculture. Computers and Electronics in Agriculture, 175, 105556 https://doi.org/10.1016/j.compag.2020.105556.