Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p <- ggplot(Dataset,aes(x=est,ymin=min, ymax=max, y=mean, shape=est))
- #Added horizontal line at y=0, error bars to points and points with size two
- p <- p + geom_hline(yintercept=0, size = 0.2, color = 'red') +
- geom_linerange(aes(ymin=min, ymax = mean), color="red") +
- geom_linerange(aes(ymin= mean, ymax=max), color="blue") +
- geom_point(size=0.2)
- #Removed legends and with scale_shape_manual point shapes set to 1 and 16
- p <- p + guides(size=FALSE,shape=FALSE) + scale_shape_manual(values=c(20, 20, 20, 20))
- #Changed appearance of plot (black and white theme) and x and y axis labels
- p <- p + theme_light() + xlab("Levels") + ylab("confident interval")
- #Final adjustments of plot
- p <- p + theme(axis.text.x=element_text(size=rel(1.2)),
- axis.title.x=element_text(size=rel(1.3)),
- axis.text.y=element_text(size=rel(1.2)),
- panel.grid.minor=element_blank(),
- panel.grid.major=element_blank())
- #To put levels on y axis you just need to use coord_flip()
- p <- p+ coord_flip()
- p
- structure(list(est = c("SOU", "EXP", "AMOU", "SIZ"), min = c(-1.988,
- 0.324809225, 0.078056746, 0.009487689), max = c(-1.893, 0.354699871,
- 0.08289443, 0.009808696), mean = c(-1.9405, 0.339754548, 0.080475588,
- 0.009648193)), .Names = c("est", "min", "max", "mean"), row.names = c(NA,
- -4L), class = c("tbl_df", "tbl", "data.frame"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement