rapport = function(var,titre) {
	# rapport dépendant du type de la variable var
	if (is.numeric(var)) {
		print(titre)
		print( paste("moyenne : ", mean(var,na.rm=T)) )
		print( paste("ecart type : ", sd(var,na.rm=T)) )
		boxplot(var,main=titre)
	} else {
		print(titre)
		print(table(var))
		pie(table(var),main=titre)
	}
}

moyenne = function(math,ang,russe) {
	# math : obligatoire, coefficient 3
	# anglais : obligatoire, coefficient 2
	# russe : facultatif, coefficient 1 et bonus à partir de 10
	sansRusse = (3*math + 2*ang) / 5
	avecRusse = (3*math + 2*ang + ifelse(russe<=10,0,russe-10)) / 5
	notes = ifelse(is.na(russe), sansRusse, avecRusse)
	return(notes)
}

avis = function(notes) {
	# [0,8[ : non
	# [8,10[ : oral
	# [10,20] : oui
	avis = ifelse(notes<8,"non", ifelse(notes<10,"oral","oui") )
		# ou : avis = cut(notes, breaks=c(0,8,10, 20), labels=c("non","oral","oui"), right=F, include.highest=T)
	return (as.factor(avis))
}

