knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(fifa2019demo)

Moyenne

Fonction qui prend en paramètre un vecteur de numérique et renvoit sa moyenne.

library(magrittr)
moyenne <- function(x){
  x <- x %>% na.omit()
  sum(x)/length(x)
}

moyenne(c(4,2,3,4,NA))


GabrielleDevaux/fifa19shinyapp documentation built on May 11, 2019, 3:09 p.m.