[R] How do I get a rough quick utility plot of a time series?
R. Michael Weylandt
michael.weylandt at gmail.com
Fri Apr 6 22:18:33 CEST 2012
This still isn't reproducible -- when I said use dput() I meant it.
x <- data.frame(x = 1:5, y = letters[1:5], z = factor(sample(1:3,5,
TRUE))) # complicated
dput(x) # Easy to copy and paste.
Also, what package is the linearizeTime function from? I'm having
trouble finding it on CRAN.
If you can dput() the exact object you want to plot, we can help you.
Michael
On Fri, Apr 6, 2012 at 2:15 PM, Hurr <hill0093 at umn.edu> wrote:
> I believe I have made this posting simple enough to understand.
> The sample time-series has only 10 times.
> SimpleTS() is the R function to contain the call to do the plot.
>
> SimpleTS <- function() {
> titleline <- readLines("SimpleTS.dta", n=1)
> print(titleline)
> dta <- read.table("SimpleTS.dta", skip = 1, header = TRUE, sep = ",",
> colClasses = "character")
> print(dta)
> dta <- linearizeTime(dta)
> print(titleline)
> print(dta)
> # plotting call goes here
> } #end SimpleTS
>
> A printout in linearizeTime(dta) is this:
> [1] "`Simple Time Series"
> Simpl CnYrMoDaHrMn SBP DBP HRT X
> 1 Simpl 201005251030 117 53 54
> 2 Simpl 201005271116 108 65 52
> 3 Simpl 201005281237 107 59
> 4 Simpl 201005291329 58
> 5 Simpl 201005301456 97 56 52
> 6 Simpl 201006011030
> 7 Simpl 201006021147 108 65 52
> 8 Simpl 201006041225 107 59
> 9 Simpl 201006051344 57 58
> 10 Simpl 201006061417 97 56 52
>
> 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
>
> We want a simple 3-tier plot with monoMn on the abscissa
> and the three functions SBP DBP HRT plotted as fct of monoMn.
> We will want more-beautiful plots later, but can't specify now.
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-do-I-get-a-rough-quick-utility-plot-of-a-time-series-tp4522709p4537994.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