[R] suppress labels in lattice barchart

Duncan Mackay dulcalma at bigpond.com
Mon Oct 17 06:01:35 CEST 2016


Hi

Try

barchart(name ~ age, data = boy.age, scales = list(y = list(alternating =
FALSE, at = 1:4, labels = rep("",4))))

see ?lattice::xyplot for details 

Regards

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au


-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Naresh
Gurbuxani
Sent: Sunday, 16 October 2016 10:44
To: R-help at r-project.org
Subject: [R] suppress labels in lattice barchart

I would like to print a barchart without labels for categorical variables.
 What change should be made to below command?

Thanks,
Naresh

boy.age <- data.frame(name = c("alpha", "beta", "charlie", "gerald"), age =
c(7, 9, 6, 5))

boy.age$name <- with(boy.age, reorder(name, age))

# draws with names on labels
barchart(name ~ age, data = boy.age, scales = list(y = list(alternating =
FALSE)))

# draws with names on labels
barchart(name ~ age, data = boy.age, ylab = "")
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list