[R] plot.window: need finite 'ylim' values

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Sun Aug 23 23:40:42 CEST 2020


Hi Mike,
This looks to me as though the error is not being generated by plot,
but by a method specific to the package, maybe something with a name
like plot.chart_Series, that is barfing on a vector of NA values.

Jim

On Mon, Aug 24, 2020 at 1:01 AM Mike <mike9 using posteo.nl> wrote:
>
> Hi Jim,
>
> on 21.08. you wrote:
>
> > Try this:
> >
> > plot (chart_Series (sample.xts[,1], subset=subset, TA=ta),
> >  type="n",ylim=c(minimum,maximum))
> >
> > where minimum and maximum are the extremes of the plot if there were
> > any valid values.
>
> I've set
> minimum <- 0
> maximum <- 1
>
> The error persists.
>
> But besides that, passing 'type="n"' to plot would only make sense
> when called once an I know there are only NAs to plot. Since I want to
> generate many charts in a loop I would have to check for plotable data
> first to decide if 'type="n"' should be passed.
>
> As a workaround for now I do something similar. I check if the range
> to be plotted is completely NA. If so I manipulate one of those
> observations (which can only be 0, 1 or NA) to an "illegal" value of
> 0.5.
>
> Mike
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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