Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider 0886a32e rédigé par simon.chevolleau's avatar simon.chevolleau
Parcourir les fichiers

fix: readTable can now handle one column df

parent c69f256e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -17,18 +17,14 @@ readTable <- function(dataName, sepUser = '\t', rnames = 1, header = TRUE, nThre
stop(paste0('ERROR: ', rnames, ', is not an integer'))
}
rownames(dat) <- as.character(dat[, rnames])
if (ncol(dat) > 2) {
dat <- dat[, -rnames]
}
dat <- dat[, -rnames, drop = FALSE]
}
if (is.character(rnames)){
if (!(rnames %in% colnames(dat))){
stop(paste0('ERROR: ', rnames, ', is not an existing column name'))
}
rownames(dat) <- as.character(dat[, rnames])
if (ncol(dat) > 2) {
dat <- dat[, colnames(dat) != rnames]
}
dat <- dat[, colnames(dat) != rnames, drop = FALSE]
}
return(dat)
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter