statistics - Easiest way to create an irregular time series graph (R? GGPLOT? ITS?) -


i'm graphic designer trying use r create graphs complicated excel. i'm trying create irregular time series step chart. i've had no problems creating regular time series chart, reason, irregular dates throwing off.

i'm starting basic text file 2 columns of data:

01-04-1940    4 05-29-1963    35 12-02-2002    24 

i've loaded data using

d <- read.delim("file.txt", header = true) 

and i've converted first column in unix time using

d$date <- as.date(d$date, format = "%m-%d-%y") 

but @ point, can't find more information anywhere on how proceed. i've seen r package "its," cannot find documentation on beyond technical descriptions of classes involved.

i'd appreciate if experience in r point out few lines of code need create graph. thanks!

ggplot deals quite nicely data in date format. here suggestions:

d <- data.frame(     date = c("01-04-1940", "05-29-1963", "12-02-2002"),     value = c(4, 35, 24) )  d$date <- as.date(d$date, format = "%m-%d-%y")  ggplot(d, aes(x=date, y=value)) + geom_step(colour="blue") 

enter image description here

ggplot(d, aes(x=date, y=value)) + geom_line(colour="red") 

enter image description here


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -