If you put NA instead of 0, then the line will 'break' when there is
no data. I don't know if this is better than going down to zero in
the case of missing data; you will have to decide. If you already
have NAs, then you can replace these with zeros.
On Jan 19, 2008 10:25 PM, obradoa <[EMAIL PRO
Use the zoo package to create a zoo object z which
represents a time series with the tabulated days as
values at the corresponding Date values. Merge that
with a zero width series containing all the dates from
the start to the end using a fill of 0. Now plot that using
plot.zoo .
f <- factor(c("
Great, this would work. Is it also possible to plot zero values for each
missing day, so when I do the line graph it properly drops to 0 if there was
no data for that day? Currently the line graph connects dots that represent
days with data present, but the line graph never drops to 0. I'd appreci
Tabulate using table(), convert the dates to Date class and plot:
f <- factor(c("10/17/07", "10/17/07", "10/17/07", "10/17/07", "10/17/07",
"10/17/07", "01/09/08", "01/17/08", "01/17/08", "01/17/08"))
ndays <- table(f)
plot(as.Date(names(ndays), "%m/%d/%y"), ndays)
On Jan 19, 2008 5:36 PM, obrad
I am trying to plot how many records are inserted into a database on a
certain date, but also represent days where no records are inserted. I can
get a list of dates for inserted records using RMySQL
result <- dbSendQuery(con, "select date_format(creation_ts, "%m/%d/%y") from
mytable;")
inserts<
5 matches
Mail list logo