Schedule view
This is great, exactly what I was looking for. I am quite new tto R, but was wondering......using the below script:
## Show schedule of projects by start / end date
#
library(ggplot2) # Visualization
# Convert timestamp to POSIXct. What do I do here to make the x-axis format to show yyyy/mm/dd? or alternatively mmm-yy?
dataset$From<-as.POSIXct(dataset$From,format="%Y-%m-%dT%H:%M:%OS")
dataset$To<-as.POSIXct(dataset$To,format="%Y-%m-%dT%H:%M:%OS")
ggplot(dataset,aes(x=datetime_start, y=dataset$Room, color=Person)) +
geom_segment(aes(x=From,xend=To,yend=dataset$Room),size=15) +
scale_colour_discrete(guide=guide_legend(override.aes=list(size=10))) +
ggtitle("Room reservations for building X") + xlab("") + ylab("") + theme_bw()
Thanks again and keep up the good work!!
Kind Regards,
Llewellyn
- Anonymous9 years agoNot applicable
Try adding a datetime scale similar to below:
scale_x_datetime(breaks = date_breaks("1 month"), labels=date_format("%d/%m/%Y"))You may also want to turn the date on the X axis for easier reading
theme(axis.text.x = element_text(angle = 90))
P.S. You'll need to load library(scales) to use the scale_x_datetime function...