Wednesday, 15 September 2010

r - Showing values over time in ggplot2 using bars instead of geometric points -



r - Showing values over time in ggplot2 using bars instead of geometric points -

i have info of next type:

time <- c("2014-10-17 09:52:42 cest", "2014-10-17 09:51:34 cest", "2014-10-17 08:22:59 cest", "2014-10-17 00:22:02 cest", "2014-10-16 23:04:49 cest", "2014-10-16 20:55:28 cest") time <- as.posixct(time, format="%y-%m-%d %h:%m:%s") value <- c(2, 2.5, 3, 6, na, 3) mydata <- data.frame(time, value)

it's easy plot points:

library(ggplot2) ggplot(data=mydata, aes(x=time, y=value)) + geom_point()

but need plot bars on time, , cannot figure out how can it. have looked through documentation on ggplot2, nil worked. seems bars tailored work factor variables , not time.

the closest thing have found is:

qplot(mydata$time)

but plots counts instead of exact values. 1 time seek add together "y" variable qplot, starts show geometric points instead of bars.

what else can try?

r ggplot2

No comments:

Post a Comment