Skip to content
Back to formatted view

Raw Message

Message-ID: <alpine.DEB.2.02.1212181941580.26806@paninaro.uibk.ac.at>
Date: 2012-12-18T18:43:36Z
From: Achim Zeileis
Subject: Changing Variable Names In VCD
In-Reply-To: <70BFE20E-86D0-4B9F-A031-EDFA270571BA@gmail.com>

Simon:

> What is the most efficient way to change the plotted variable names in 
> mosaic plots in the vcd package? Should one do a separate contingency 
> table first, change the dimension names there and then pass that to 
> mosaic? Or is there a way to do it simply within mosaic.
> I was thinking something like:
> mosaic(~var1+var2, labelling_args=list(varnames=c('newvar1', 'newvar2'))

Almost. The default labeling function is labeling_border which does take a 
varnames argument but this should be logical (should labels be drawn or 
not?). The argument set_varnames can be used to set the varnames to 
different strings, e.g.,

mosaic(~ Gender + Admit, data = UCBAdmissions,
   labeling_args = list(set_varnames = list(Gender = "Foo", Admit = "Bar")))

I hope this is what you're looking for.

Best,
Z

> Simon Kiss
> *********************************
> Simon J. Kiss, PhD
> Assistant Professor, Wilfrid Laurier University
> 73 George Street
> Brantford, Ontario, Canada
>
> ______________________________________________
> 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.
>