Skip to content
Prev 76986 / 398502 Next

Question about plotting discontinuous data

On 9/9/05, Larsen Chung <ychung4 at uiuc.edu> wrote:
Suppose this is your input data:

xx <- 11:12
tt <- c(830.1, 1230.5)

# use the times class in chron library
library(chron)
tt.times <- times(paste(tt %/% 100, floor(tt %% 100), (100 * tt) %%
100, sep = ":"))
plot(tt.times, xx)

# or represent it as a zoo object and plot that
library(zoo)
z <- zoo(xx, tt.times)
plot(z)