The purpose of this exercize was to begin to use our R skills to replicate a simple bar plot. We had to read in data from a txt file, discover colors that are not default colors in R, and include labels.

Data Entry

jmen <- read.table("jmen.txt", header=TRUE)

Imitation Graph

#barplot of hair color
hair_table <- table(jmen$Hair)
barplot(hair_table, col=c("Black", "khaki1", "orange4", "tomato"), main = "Hair Color of Sampled JMEN", xlab= "Hair Colors", ylab = "Number of Men", names.arg=c("Black", "Blond(e)", "Brown", "Red"))

I was able to imitate the graph fairly well. The only thing that might not be exactly the same is the color orange4 which is the color of the bar for brown hair.