[R] formula version of sunflowerplot() fails when axis label specified

David L Carlson dcarlson at tamu.edu
Wed Jun 27 17:12:46 CEST 2012


It seems to be a bug when you specify an x-label.

# No xlab= works fine, but uses variable names to label x and
# y axes

> sunflowerplot(Sepal.Length~Sepal.Width, data=iris)

# These all throw the error message
> sunflowerplot(Sepal.Length~Sepal.Width, data=iris, xlab="A")
> sunflowerplot(Sepal.Length~Sepal.Width, data=iris, xlab="")
> sunflowerplot(Sepal.Length~Sepal.Width, data=iris, xlab="Sunflowers")

The work around would be to set up the plot and with plot() and then 
add the sunflowerplot

> x <- range(iris$Sepal.Width)
> y <-  range(iris$Sepal.Length)
> plot(x, y, type="n", xlab="A", ylab="")
> sunflowerplot(Sepal.Length~Sepal.Width, data=iris, add=TRUE)

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Gerrit Eichner
> Sent: Wednesday, June 27, 2012 6:17 AM
> To: R-Help
> Subject: [R] formula version of sunflowerplot() fails when axis label
> specified
> 
> Hello, R-help,
> 
> does anybody have already a work-around for the problem that the
> formula
> version of sunflowerplot() throws an error when provided with a value
> for
> xlab (or ylab) different from NULL:
> 
> > sunflowerplot( Sepal.Length ~ Sepal.Width, data = iris, xlab = "A")
> Error in model.frame.default(formula = Sepal.Length ~ Sepal.Width, data
> = iris,  :
>    variable lengths differ (found for '(xlab)')
> 
> And are you -- the one with the work-around -- willing to share it? :)
> 
>   Best regards  --  Gerrit
> 
> ---------------------------------------------------------------------
> Dr. Gerrit Eichner                   Mathematical Institute, Room 212
> gerrit.eichner at math.uni-giessen.de   Justus-Liebig-University Giessen
> Tel: +49-(0)641-99-32104          Arndtstr. 2, 35392 Giessen, Germany
> Fax: +49-(0)641-99-32109        http://www.uni-giessen.de/cms/eichner
> 
> ______________________________________________
> 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