knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

  library(magrittr)

envEcosystems: an R package of objects and tools to create ecosystem descriptions

The goal of envEcosystems is to help create ecosystem descriptions based on outputs from other envPackages.

Installation

envEcosystems is not on CRAN.

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("Acanthiza/envEcosystems")

Load envEcosystems

library("envEcosystems")

Convert between cover value systems

lucover provides a lookup table from modified Braun-Blanquet cover codes to various numeric cover values.

  lucover

What else is in envEcosystems

The following functions and data sets are provided in envEcosystems. See https://acanthiza.github.io/envEcosystems/ for more examples.

  get_name_title <- function(text) {

    tibble::enframe(text
                    , name = NULL
                    , value = "description"
                    ) %>%
      dplyr::filter(grepl("title", description)) %>%
      dplyr::mutate(description = gsub("\\\\|title", "", description)
                    , description = gsub("^\\{|\\}$", "", description)
                    )

  }

  manuals <- fs::dir_info("man") %>%
    dplyr::select(path) %>%
    dplyr::filter(grepl("Rd$", path)
                  , !grepl("pipe", path)
                  ) %>%
    dplyr::mutate(object = gsub("man\\/|\\.Rd","",path)
                  , class = purrr::map_chr(object, ~envFunc::vec_to_sentence(class(get(.))))
                  , text = purrr::map(path, readLines)
                  , text = purrr::map(text, get_name_title)
                  , object = paste0("["
                                  , object
                                  , dplyr::if_else(class == "function"
                                                   , "()"
                                                   , ""
                                                   )
                                  , "]"
                                  )
                  ) %>%
    tidyr::unnest(cols = c(text))

  knitr::kable(manuals[,2:4])


Acanthiza/envEcosystems documentation built on May 21, 2024, 6:20 p.m.