[R] Removing unused parameter in qqplot

Peter Maclean pmaclean2011 at yahoo.com
Tue Jan 7 01:36:29 CET 2014


With these toy data, how can I remove unused empty space between the bars?
 
#Toy data
x1 <- as.data.frame(rep(1:3,   c(10,2,6)))
colnames(x1) <- c("name")
x2 <- as.data.frame(rep(5:7,   c(14,5,8)))
colnames(x2) <- c("name")
x3 <- as.data.frame(rep(10:12, c(5,5, 8)))
colnames(x3) <- c("name")
x4 <- as.data.frame(rep(18, 9))
colnames(x4) <- c("name")
dat <- rbind.data.frame(x1, x2, x3, x4)
dat <- as.data.frame(dat)
colnames(data) <- c("name")
fix(dat)
require(ggplot2)
ggplot(dat , aes(x=name, y = ..density..)) +
         geom_histogram(colour = "darkgreen", fill = "blue", binwidth = 0.5) 
  
 


Peter Maclean
Department of Economics
UDSM



More information about the R-help mailing list