Rob Shield
Rob Shield

Reputation: 1

Having trouble naming title, x and y axis on histogram, getting error message

I'm having trouble putting labels on my histogram of this subset of data:

hist(Familiar$letterCount, main = "Letter count of Familiar Words", xlab = "Letter Count", ylab = "Frequency", abline(v = mean(Familiar$letterCount), col = "black"))

and I'm getting the error message:

invalid breakpoints produced by 'breaks(x)' null r

I apologize if this was not properly formatted for stack overflow, but what mistake am I making here?

Upvotes: 0

Views: 93

Answers (1)

Fer Arce
Fer Arce

Reputation: 149

you have included 'abline' function inside 'hist' function. Try the following:

hist(Familiar$letterCount, main = "Letter count of Familiar Words",
     xlab = "Letter Count", ylab = "Frequency")

abline(v = mean(Familiar$letterCount), col = "black")

Upvotes: 1

Related Questions