#' Oui/Non/Nsp
#'
#'Réorganise toutes les variables non/nsp/oui vers oui/non/nsp dans un data.frame
#'
#' @param tt data.frame
#'
#' @return data.frame
#' @export
nspouiph <- function(tt){
ltt <- length(tt)
for (i in 1:ltt){
if(is.integer(tt[,i])==F & is.numeric(tt[,i])==F & length(levels(tt[,i]))==3){
if (levels(tt[,i])[1]=="non" & levels(tt[,i])[2]=="nsp"){
tt[,i] <- as.factor(tt[,i])
tt[,i] <- factor(tt[,i],c("oui","non","nsp"))
print("$")
}
}}
print(levels(tt$iot))
return(tt)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.