[R] How do I get a rough quick utility plot of a time series?

R. Michael Weylandt michael.weylandt at gmail.com
Sat Apr 7 15:52:50 CEST 2012


One last try -- though if you cannot figure out how to take the name
of your object and put it in dput( NameOfObjectGoesHere ) after I gave
you a worked example of how to do so, it seems unlikely that this will
help:

# Attempt to recreate your data
library(zoo)
x <- read.zoo(textConnection("monoMn SBP DBP HRT
1  1057366710 117  53  54
2  1057369636 108  65  52
3  1057371157 107  NA  59
4  1057372649  NA  NA  58
5  1057374176  97  56  52
6  1057376790  NA  NA  NA
7  1057378307 108  65  52
8  1057381225 107  NA  59
9  1057382744  NA  57  58
10 1057384217  97  56  52"))
closeAllConnections()


dput(x) # See how easy this was -- this can be directly copied and pasted
plot(x, type = "o")

Note that this code can be verbatim copied and pasted -- it is both
minimal and reproducible, not like what you had.

Now in your case, you still haven't given me dput() of your object, so
I can't tell you how to convert it to zoo properly, but, as you can
see, it's exceptionally easy to get the desired plot once you do so.

Take a look at ?as.zoo -- maybe you can figure it out on your own.

Michael

On Fri, Apr 6, 2012 at 5:06 PM, Hurr <hill0093 at umn.edu> wrote:
> linearizeTime() is from the restof my own code and the rest if my code is not
> small.
> That is why I gave you the printout and the code line that produced it.
> The printout at the end of SimpleTS() is this:
> [1] "`Simple Time Series"
>       monoMn SBP DBP HRT
> 1  1057366710 117  53  54
> 2  1057369636 108  65  52
> 3  1057371157 107  NA  59
> 4  1057372649  NA  NA  58
> 5  1057374176  97  56  52
> 6  1057376790  NA  NA  NA
> 7  1057378307 108  65  52
> 8  1057381225 107  NA  59
> 9  1057382744  NA  57  58
> 10 1057384217  97  56  52
> It's a simple plot, and if you know how to plot it should be easy for you.
> I don't know how to do what you require, having used R very little.
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-do-I-get-a-rough-quick-utility-plot-of-a-time-series-tp4522709p4538331.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list