Chris Heckman
Chris Heckman

Reputation: 121

r: boxplot names="" with single vector

I cannot get names to work in box plot. Is it not working because I only have a single vector? Heres what I have tried.

tmp = c(1,1,1,1,2,2,2,2,5,5,5,5,5,6,5,4,7)
boxplot(tmp)
boxplot(tmp, names=c("today"))
boxplot(tmp, names="today")
boxplot(tmp, labels="today")
boxplot(tmp, labels=c("today")

Upvotes: 3

Views: 1029

Answers (2)

It Figures
It Figures

Reputation: 411

boxplot(tmp, names=c("today"),show.names=TRUE)

Upvotes: 3

Sam Gilbert
Sam Gilbert

Reputation: 1702

I was having the same issue and found an alternative at the below link

https://stackoverflow.com/a/25590238/4092304

So could be coded as ...

boxplot(tmp, xlab = "today")

Upvotes: 1

Related Questions