[R] Invalid 'yscale' in viewport

R. Michael Weylandt michael.weylandt at gmail.com
Wed Nov 9 19:44:53 CET 2011


Two things:

1) It sounds like you are right in thinking there's something funny
about your particular data: could you provide it to us? The easiest
way to do so is to use dput() to get a plain text representation ready
for copy and paste.

2) What is esplot()? It's not in base R, but I imagine you are
referring to Deepayn's script here:
http://www.stat.wisc.edu/~deepayan/771/esplot.R ? Just to confirm in
case there is something that needs looking at in the code.

Thanks,

Michael

On Wed, Nov 9, 2011 at 10:20 AM, Erin Jonaitis <jonaitis at wisc.edu> wrote:
> I tried Googling for help on this problem, but what I saw only increased my
> puzzlement.
>
> I found a lovely bit of code called esplot() that makes scatterplots with
> associated histograms and rug plots.  I have been trying to use it on my own
> data, but the viewport routine on which it depends (I think) is choking on the
> data I'm trying to plot.
>
> $ Error in valid.viewport(...) : Invalid 'yscale' in viewport
>
> When I Google this error, I see that others get this message when trying to plot
> dates.  However, my data are two numeric vectors.  The strange part is that
> these vectors are in fact date differences -- they started life as dates -- but
> I've already converted them to numeric, like so:
>
> $ cogdiff <- as.numeric(cogdate - scandate)/365.24
> $ labdiff <- as.numeric(labdate - scandate)/365.24
>
> When I check is(cogdiff) and is(labdiff) it tells me that both are numeric
> vectors.  And if I put these variables into other plotting routines (e.g.
> plot(), qplot()), I get the expected output.  So on some level the conversion to
> numeric has "worked."
>
> However: as a sanity check I also tried the esplot() routine on two random
> vectors I generated, and it DID work on those -- no error message.  So I don't
> think I'm missing any other key dependencies.  Something else must be funny
> about my cogdiff and labdiff variables, but I'm at a loss about what it could be
> and am looking for suggestions.
>
> Thanks in advance...
>
>
> Erin Jonaitis
>
> ______________________________________________
> 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