# Plot Factor

# load the library
library(mlbench)
# load the dataset
data(BreastCancer)
datos <- BreastCancer
# hacemos un barplot
counts <- table(datos[,2])
name <- names(datos)[2]
barplot(counts,main=name)
# create a bar plot of each categorical attribute
par(mfrow=c(3,3))
for(i in 2:10) {
  counts <- table(datos[,i])
  name <- names(datos)[i]
  barplot(counts,main=name)
}

