A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

extractOz

Extract the Global Runoff Data Centre agroecological zone, major soil order and weather data from your GPS sampling points.
https://github.com/dpird-fsi/extractoz

Category: Consumption
Sub Category: Agriculture and Nutrition

Keywords

agriculture agriculture-data agriculture-research agroecology australia r-package soils soils-data weather weather-data

Keywords from Contributors

agricultural-modeling climate weather-api file-upload weighted unitful simulations report crop transform

Last synced: about 2 hours ago
JSON representation

Repository metadata

{extractOz}: Get local attribute information from GPS points for Australian agricultural research

README.Rmd

          ---
title: ""
output: github_document
---

# {extractOz}: A Unified Approach to Extracting Data About Australian Locations Using GPS Points 


[![codecov](https://codecov.io/gh/DPIRD-FSI/extractOz/branch/main/graph/badge.svg?token=PBtL3rNIYb)](https://codecov.io/gh/DPIRD-FSI/extractOz)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![R-CMD-check](https://github.com/DPIRD-FSI/extractOz/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/DPIRD-FSI/extractOz/actions/workflows/R-CMD-check.yaml)


Extract the GRDC agroecological zone, major soil order and weather data from your GPS sampling points.
Datasets for the GRDC agroecological zones and functions that automatically download modified data from the Digital Atlas of Australian Soils are included in this package for ease of use.
You may also use your own geospatial vector format file to extract similar information using the generic function, `extract_area()`.

## Quick Start

You can install {extractOz} like so.

```{r setup, eval=FALSE}
if (!require("remotes")) {
  install.packages("remotes")
}

remotes::install_github("DPIRD-FSI/extractOz", build_vignettes = TRUE)
```

Load the packages necessary to execute the examples that follow.

```{r load-libs}
library(extractOz)
library(dplyr)
```

## Create Locations in WA and NSW

```{r create-locs}
locs <- list(
  "Merredin" = c(x = 118.28, y = -31.48),
  "Corrigin" = c(x = 117.87, y = -32.33),
  "Tamworth" = c(x = 150.84, y = -31.07)
)
```

## Extract the GRDC AgroEcological Zones

See `?extract_ae_zone()` for more help on how to use this function.

```{r az-zone}
z <- extract_ae_zone(x = locs)
```

## Extract the Soil Order

See `?extract_soil_order()` for more help on how to use this function.

```{r soil-order}
s <- extract_daas_soil_order(x = locs)
```

## Get Weather Data for These Locations in 2020

Using the previously used list of GPS points, fetch weather data from SILO for 2020.
This is just a non-working example, replace `your_api_key` with your email address below.
See `?extract_patched_point()` for more help on how to use this function.

### A Note on API Keys

The examples in this README assume that you have stored your API key in your .Renviron file.
See [Chapter 8](https://rstats.wtf/r-startup.html#renviron) in "What They Forgot to Teach You About R" by Bryan _et al._ for more on storing details in your .Renviron if you are unfamiliar.

```{r ppd}
three_sites <-
  extract_patched_point(
    x = locs,
    start_date = "20200101",
    end_date = "20201231",
    api_key = Sys.getenv("SILO_API_KEY")
  )
```

## Join the Weather Data with AE Zone, Soil Order and Site Information

Now using `dplyr::left_join()`, create a single `data.frame()` of the location, GPS coordinates, agroecological zone and weather data.

```{r join-all}
left_join(z, three_sites, by = c(
  "location" = "location",
  "x" = "x",
  "y" = "y"
)) %>%
  left_join(s)
```

## Code of Conduct

Please note that the {extractOz} project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

        

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 313
Total Committers: 4
Avg Commits per committer: 78.25
Development Distribution Score (DDS): 0.067

Commits in past year: 114
Committers in past year: 3
Avg Commits per committer in past year: 38.0
Development Distribution Score (DDS) in past year: 0.167

Name Email Commits
Adam H. Sparks a****s@i****m 292
Adam H. Sparks a****s@c****u 18
github-actions[bot] 4****] 2
Adam Sparks A****s@d****u 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 13
Total pull requests: 8
Average time to close issues: 6 months
Average time to close pull requests: 9 days
Total issue authors: 2
Total pull request authors: 1
Average comments per issue: 1.38
Average comments per pull request: 0.25
Merged pull request: 8
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: 4 minutes
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 2
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/dpird-fsi/extractoz

Top Issue Authors

  • adamhsparks (12)
  • kaibagley (1)

Top Pull Request Authors

  • adamhsparks (8)

Top Issue Labels

  • enhancement (7)
  • bug (1)
  • wontfix (1)

Top Pull Request Labels


Dependencies

DESCRIPTION cran
  • R >= 4.0.0 depends
  • cropgrowdays * imports
  • curl * imports
  • httr * imports
  • sf * imports
  • utils * imports
  • knitr * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat >= 3.0.0 suggests
  • tidyverse * suggests
.github/workflows/tic.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v2 composite
  • pat-s/always-upload-cache v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/update-tic.yml actions
  • actions/checkout v3 composite
  • peter-evans/create-pull-request v4 composite
  • r-lib/actions/setup-r v2 composite

Score: 2.772588722239781