inst/snippet/vcd-mosaic-fig.R

vcd::mosaic(~ victim + defendant + death, 
            shade = TRUE,
            data = DeathPenalty %>%
              mutate(  # abbreviate labels to fit plot better
                victim = abbreviate(victim, 2),
                defendant = abbreviate(defendant, 2),
                death = abbreviate(death, 1))
)

Try the fastR2 package in your browser

Any scripts or data that you put into this service are public.

fastR2 documentation built on Nov. 9, 2023, 9:06 a.m.