1
0
mirror of https://github.com/andre-wojtowicz/uci-ml-to-r.git synced 2024-07-22 07:35:30 +02:00
uci-ml-to-r/data-collection/breast-cancer-wisconsin-diagnostic/preprocess.R

19 lines
774 B
R

preprocess.dataset = function()
{
csv.file = "wdbc.data"
dataset = read.csv(file.path(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)
}