#Importation des packages
library(tidyverse)
library(janitor)
library(sf)
library(mapview)
# Importation des données - Informations opération pêche
base_operation <-
  readxl::read_xls(path = '~/Stage_M2_LR_BFC/Red_list_R_project/Red_list_fish/Liste_rouge_BFC/raw_data/RHP-RCS-RCO-REF DR 9.xls', sheet = "DONNEES SOURCE")

1 Selection pour nouvelle colonne

Dans la colonne du reseau, si = 1 alors 1 = “nom du reseau”

ope_clean <- base_operation %>% # Ctrl+shift+M
  janitor::clean_names() %>% 
  mutate(
    protocole = as.factor(protocole), 
    #reseaux = ifelse(str_detect(statut_observation, '^Pr'), yes = 'Présent', no = 'Absent')
  )
summary(ope_clean$protocole)
##  1 electrode 2 electrodes       points         NA's 
##           13           53           96           23
# Représentation cartographique du secteur d'étude et des stations correspondants

sites_geo <- ope_clean %>%
  filter(!is.na(xaval_l93) & !is.na(yaval_l93)) %>%
  dplyr::select(
    code_station_bhp,
    xaval_l93,
    yaval_l93,
    nom_sandre,
    protocole,
    mode_prospection,
    annee_peche
  ) %>%
  st_as_sf(coords = c("xaval_l93", "yaval_l93"), crs = 2154)


mapview(
  sites_geo,
  zcol = "protocole",
  col.regions = c("darkseagreen3" , "purple4", "indianred1")
)