1
0
mirror of https://github.com/andre-wojtowicz/uci-ml-to-r.git synced 2024-12-01 16:40:28 +01:00
uci-ml-to-r/data-collection/breast-cancer-wisconsin-diagnostic/preprocess.R

18 lines
764 B
R

preprocessDataset = function()
{
csv.file = "wdbc.data"
dataset = read.csv(paste0(orig.dir, "/", csv.file), header=FALSE)
colnames(dataset) = c("id", "diagnosis",
apply(expand.grid(c("radius", "texture", "perimeter",
"area", "smoothness", "compactness",
"concavity", "concave points",
"symmetry", "fractal dimension"),
c("mean", "se", "worst")),
1, function(x){paste(x[2], x[1])}))
dataset = dataset %>% select(`mean radius`:`worst fractal dimension`, diagnosis)
return(dataset)
}