Skip to content

Instantly share code, notes, and snippets.

@jsaraviadrago
Last active August 6, 2019 19:02
Show Gist options
  • Save jsaraviadrago/680cb0c8065db5f58db41f9fda1af31e to your computer and use it in GitHub Desktop.
Save jsaraviadrago/680cb0c8065db5f58db41f9fda1af31e to your computer and use it in GitHub Desktop.
### Tabla de sedes de 5 años con estudiantes de 5 años
#' @param data para ser usada
#' @param ... variables que uno utiliza para agregar y hacer la tabla
table5 <- function(data,...){
tabla <- data %>%
group_by(...) %>%
summarise(n=n()) %>%
mutate(PORCENTAJE = round(n/sum(n)*100,1),
ETIQUETA = paste0(round(n/sum(n)*100,1),"%"))
tabla <- data.frame(tabla)
return(tabla)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment