Skip to content

Commit

Permalink
removing unused function option and updating readme (#208)
Browse files Browse the repository at this point in the history
* removing unused function option and updating readme

* more readme updates

* more work on readme
  • Loading branch information
wcornwell authored May 2, 2024
1 parent 9be9776 commit e0e9086
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 32 deletions.
3 changes: 0 additions & 3 deletions R/load_taxonomic_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#' dataset from a github archived file. If set to "current", the dataset will be loaded from
#' a URL which is the cutting edge version, but this may change at any time without notice.
#' @param version The version number of the dataset to use. Defaults to the default version.
#'
#' @param reload A logical indicating whether to reload the dataset from the data source. Defaults to FALSE.
#'
#' @param quiet A logical indicating whether to print status of loading to screen. Defaults to FALSE.
#'
Expand All @@ -25,7 +23,6 @@
load_taxonomic_resources <-
function(stable_or_current_data = "stable",
version = default_version(),
reload = FALSE,
quiet = FALSE) {


Expand Down
48 changes: 40 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,66 @@ the established status (native/introduced) of plant taxa across different states

## Installation

'APCalign' is current not on CRAN. Install the currently development version:
For Windows and Linux:

```{r install, eval= FALSE}
# install.packages("remotes")
# remotes::install_github("traitecoevo/APCalign", dependencies = TRUE, upgrade = "ask")
library(APCalign)
```

for MacOS there is currently an extra line needed to install a working binary of the `arrow` dependency from r-universe instead of CRAN:

```{r install_mac, eval= FALSE}
# install.packages("arrow", repos = c('https://apache.r-universe.dev', 'https://cloud.r-project.org'))
# remotes::install_github("traitecoevo/APCalign", dependencies = TRUE, upgrade = "ask")
```


## A quick demo

Generating a look-up table can be done with just one function
Generating a look-up table can be done with just one function:

```{r}
```{r,message=FALSE}
# Load APC/APNI resources into R
resources <- load_taxonomic_resources()
library(APCalign)
# Create lookup
create_taxonomic_update_lookup(
taxa = c(
"Banksia integrifolia",
"Acacia longifolia",
"Commersonia rosea"
)
)
```

if you're going to use APCalign more than once, it will save you time to load the taxonomic resources into memory first:

```{r}
tax_resources <- load_taxonomic_resources()
create_taxonomic_update_lookup(
taxa = c(
"Banksia integrifolia",
"Acacia longifolia",
"Commersonia rosea",
"not a species"
),
resources = resources
resources = tax_resources
)
```

Checking for Australian natives:

```{r, message=FALSE}
native_anywhere_in_australia(c("Eucalyptus globulus","Pinus radiata"), resources = tax_resources)
```
## Shiny application

We also developed a shiny application for non-R users to update and align their taxonomic names. You can find the application here: https://unsw.shinyapps.io/APCalign-app
Expand Down
93 changes: 75 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,99 @@ taxa across different states/territories.

## Installation

‘APCalign’ is current not on CRAN. Install the currently development
version:
For Windows and Linux:

``` r

# install.packages("remotes")
# remotes::install_github("traitecoevo/APCalign", dependencies = TRUE, upgrade = "ask")
```

library(APCalign)
for MacOS there is currently an extra line needed to install a working
binary of the `arrow` dependency from r-universe instead of CRAN:

``` r

# install.packages("arrow", repos = c('https://apache.r-universe.dev', 'https://cloud.r-project.org'))
# remotes::install_github("traitecoevo/APCalign", dependencies = TRUE, upgrade = "ask")
```

## A quick demo

Generating a look-up table can be done with just one function
Generating a look-up table can be done with just one function:

``` r
# Load APC/APNI resources into R
resources <- load_taxonomic_resources()

# Create lookup
library(APCalign)

create_taxonomic_update_lookup(
taxa = c(
"Banksia integrifolia",
"Acacia longifolia",
"Commersonia rosea"
),
resources = resources
)
)
#> # A tibble: 3 × 12
#> original_name aligned_name accepted_name suggested_name genus taxon_rank
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Banksia integrifol… Banksia int… Banksia inte… Banksia integ… Bank… species
#> 2 Acacia longifolia Acacia long… Acacia longi… Acacia longif… Acac… species
#> 3 Commersonia rosea Commersonia… Androcalva r… Androcalva ro… Andr… species
#> # ℹ 6 more variables: taxonomic_dataset <chr>, taxonomic_status <chr>,
#> # scientific_name <chr>, aligned_reason <chr>, update_reason <chr>,
#> # number_of_collapsed_taxa <dbl>
#> Checking alignments of 3 taxa
```

#> Loading resources into memory...
#> ================================================================================================================================================================
#> ...done
#> -> of these 2 names have a perfect match to a scientific name in the APC. Alignments being sought for remaining names.
#> # A tibble: 3 × 12
#> original_name aligned_name accepted_name suggested_name genus taxon_rank
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Banksia integrifol… Banksia int… Banksia inte… Banksia integ… Bank… species
#> 2 Acacia longifolia Acacia long… Acacia longi… Acacia longif… Acac… species
#> 3 Commersonia rosea Commersonia… Androcalva r… Androcalva ro… Andr… species
#> # ℹ 6 more variables: taxonomic_dataset <chr>, taxonomic_status <chr>,
#> # scientific_name <chr>, aligned_reason <chr>, update_reason <chr>,
#> # number_of_collapsed_taxa <dbl>

if you’re going to use APCalign more than once, it will save you time to
load the taxonomic resources into memory first:

``` r

tax_resources <- load_taxonomic_resources()
```

#> Loading resources into memory...
#> ================================================================================================================================================================
#> ...done

create_taxonomic_update_lookup(
taxa = c(
"Banksia integrifolia",
"Acacia longifolia",
"Commersonia rosea",
"not a species"
),
resources = tax_resources
)
#> Checking alignments of 4 taxa
#> -> of these 2 names have a perfect match to a scientific name in the APC. Alignments being sought for remaining names.
#> # A tibble: 4 × 12
#> original_name aligned_name accepted_name suggested_name genus taxon_rank
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 Banksia integrifol… Banksia int… Banksia inte… Banksia integ… Bank… species
#> 2 Acacia longifolia Acacia long… Acacia longi… Acacia longif… Acac… species
#> 3 Commersonia rosea Commersonia… Androcalva r… Androcalva ro… Andr… species
#> 4 not a species <NA> <NA> <NA> <NA> <NA>
#> # ℹ 6 more variables: taxonomic_dataset <chr>, taxonomic_status <chr>,
#> # scientific_name <chr>, aligned_reason <chr>, update_reason <chr>,
#> # number_of_collapsed_taxa <dbl>

Checking for Australian natives:

``` r

native_anywhere_in_australia(c("Eucalyptus globulus","Pinus radiata"), resources = tax_resources)
#> # A tibble: 2 × 2
#> species native_anywhere_in_aus
#> <chr> <chr>
#> 1 Eucalyptus globulus native
#> 2 Pinus radiata introduced
```

## Shiny application
Expand Down
3 changes: 0 additions & 3 deletions man/load_taxonomic_resources.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e0e9086

Please sign in to comment.