ggplot2 - R + ggplot: plotting irregular time series -
i have data @ number of days since event. data sampled irregularly - time points 0, 5, 6, 10, 104 days. don't have specific date-time information - i.e. have no idea when in real life event i'm studying occurred.
i'd plot, using ggplot, time series. can use, say
p <- ggplot(data,aes(x=time,y=expression)) p <- p + geom_point()
but of course x-axis variables plotted next each other, distance between t=10 , t=104 same t=5 , t=6. can make like
start <- isodate(2001, 1, 1, tz = "") data$time <- start + data$time*60*60*12
which works, ticks on x-axis horribly inaccurate date times. re-format them maybe? can't see anyway make format "days start". , i've been googling around quite while, nagging feeling i'm missing obvious. i?
sounds time
variable factor or maybe character vector, not numeric value! if data$time <- as.numeric(data$time)
may solve problem.
ggplot pretty @ using right sort of scale right sort of data. (sadly, data import routines in r less smart...)
Comments
Post a Comment