[R] RES: Barplot with "Independent" Lines Y axis
r.aluizio at gmail.com
Thu Dec 9 20:26:58 CET 2010
Thank you for the function suggestion, works nicely for complete data
vectors. Just another question. When using the twoord.plot I reached another
issue, it seems that this function can't handle NAs in one of the variables
(the data of one month for another variable is missing). The lines and
barplot functions just interrupt the plot and continue after the NA but
twoord.plot gives me an error: Error at plot.window(...) : finite values are
necessary for 'ylim'
Is there a way to work around this error?
P.S.: I'm aware of the problems regarding this type of graph, but this time
it's not a choice of mine (unfortunately). Thank you anyway for the
highlight, maybe it will help me arguing.
De: Greg Snow [mailto:Greg.Snow em imail.org]
Enviada em: quinta-feira, 9 de dezembro de 2010 15:56
Para: Rodrigo Aluizio; R Help
Assunto: RE: [R] Barplot with "Independent" Lines Y axis
Look at the twoord.plot function in the plotrix package, but be sure to read
the note on the help page, then reread it and take its advice if you decide
to stick with this type of plot.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow em imail.org
> -----Original Message-----
> From: r-help-bounces em r-project.org [mailto:r-help-bounces em r-
> project.org] On Behalf Of Rodrigo Aluizio
> Sent: Thursday, December 09, 2010 9:44 AM
> To: R Help
> Subject: [R] Barplot with "Independent" Lines Y axis
> Hi list. I'm plotting pluviometric (Rain) data as a barplot, and then
> the salinity variable to this plot as lines. Obviously as these Y
> scales are
> completely different the salinity appears at the lower part of the
> extremely compacted. I need to plot the line at the exactly same area
> of the
> barplot but with its own Y axis (at the right), so the salinity can use
> plot area freely. I tried the par(new=T), but it only works for high
> plot functions (not for lines or points).
> Below are some example data and the code I'm using:
> Month Rain Salt
> Fev 365.6 13
> Mar 235 18
> Abr 115.1 18
> Mai 47.4 18.75
> Jun 112 15
> Jul 156.8 17
> Ago 66.1 15
> Set 149.8 14
> Out 167.1 11.5
> Nov 269.3 17.5
> Any ideas?
> Thank you for the attention.
> MSc. Rodrigo Aluizio
> Centro de Estudos do Mar/UFPR
> R-help em r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help