#'f
#'
#' la fonction f est utlisée pour la construction des objets de classe "comp_reg".
#'
#' @param nom1 nom de région
#' @param nom2 nom de région
#'
#' @return data frame
#' @examples f("CORSE","BRETAGNE")
#' @export
#' @import dplyr
#' @importFrom dplyr %>%
f<-function(nom1,nom2){
ResMetBE17 %>%
dplyr::select(nom_metier,REG,NOM_REG,met)%>%
dplyr::filter(NOM_REG %in% c(nom1,nom2))%>%
dplyr::group_by(nom_metier,NOM_REG)%>%
dplyr::summarise_at(vars(met),funs(sum))%>%
dplyr::ungroup()%>%
dplyr::group_by(`NOM_REG`)%>%
dplyr::mutate(pct = prop.table(met) * 100)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.