R/fct_tableFct.R

Defines functions colTable

# CREATE FUNCTIONS TO RETURN DATA FOR USE IN THE BOX TABLE

colTable <- function(data, ...){

  df_sf <- data %>%
    sf::st_as_sf(coords = c("lonApp","latApp"), crs = 4326)
  
  init <- FALSE
  
  for (i in list(...)) {
    col <- unique(df_sf[i])
    # col <- unique(data[i])
    
    if (!init) {
      df <- col
      init <- TRUE
    } else {
      df <- cbind(df,col)
    }
  }
  return(df)
}
Camil88/geoMapX documentation built on April 14, 2023, 10:36 a.m.