R/data0061-vulnerability_habitat_kappel.R

Defines functions get_data0061

Documented in get_data0061

#' Data 0061 : Vulnerability scores for 58 stressors in 15 ecosystems
#'
#' Matrix of vulnerability scores for 58 different types of stressors in 15 types of intertidal, subtidal and offshore ecosystems by Kappel et al. (2012).
#'
#' @keywords vulnérabilité
#' @keywords habitat
#'
#' @source Kappel, Halpern, and Napoli. (2012, January) Mapping Cumulative Impacts of Human Activities on Marine Ecosystems (03.NCEAS.12) Boston: SeaPlan.
#'
#' @export
#'
#' @details Cette fonction formatte les données
#'

get_data0061 <- function() {
  # =~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~= #
  #
  # WARNING: Données ne peuvent être partagées
  # WARNING: Données brutes doivent être supprimées suite au projet
  # _________________________________________________________________________ #

  # WARNING: Data transfered physically, no cloud access currently
  # Output folder
  output <- "data0061-vulnerability_habitat_kappel/"
  folder <- paste0("./data/data-raw/", output)
  if (!file.exists(folder)) dir.create(folder)


  # _________________________________________________________________________ #

  # =~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~= #
  # Import and format
  # ----------------------------------------
  # Load vessel type dataset
  data0061 <- read.csv(paste0(folder, 'vulnerability_matrix_kappel.csv'))
  # _____________________________________________________________________________ #


  # =~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~=~-~= #
  # Export data
  # ----------------------------------------
  # Output
  write.csv(x = data0061,
            file = "./data/data-format/data0061-vulnerability_habitat_kappel.csv",
            row.names = FALSE)
  # _________________________________________________________________________ #
}
EffetsCumulatifsNavigation/ceanav documentation built on April 17, 2023, 1:02 p.m.