Questions tagged [ggmosaic]

An R package to create mosaic plots in the 'ggplot2' framework.

22 questions
0
votes
2 answers

ggmosaic doesn't display the correct column names in title or x-axis

I'm trying to generate multiple plots with ggmosaic using a for loop (or map) but I'm not able to pull out the correct title names or x-axis names. This is example of the dataframe: set.seed(42) ## for sake of reproducibility n <- 10 dat <-…
tucomax
  • 71
  • 1
  • 6
0
votes
1 answer

How to make the mosaic plots of 20 dataframes and put them in one page in r?

I created 20 data frames in a loop already. And assigned them in the loop as below for(x in 1:20){ my_file <- read.table(paste0("file_name",x), head=TRUE) %>% select(Count, Total) %>% data.frame() assign(paste0("my_file_",x),…
0
votes
1 answer

Reorder factor in mosaic plot in R with ggmosaic and geom_mosaic()

I have tried to familiarise myself with making mosaic plots in R with the ggmosaic package's geom_mosaic() command. My problem is that I want the regions to be ordered by the share of seniors in each region, and not by name as now. Any help? I am…
0
votes
0 answers

Changing tick marks on geom_mosaic plot

I have the following dataset in R, which I want to make into a mosaic plot using ggplot2 and ggmosaic. type variable count residuals residcut residround see.m aca 44 4.380270 high 4 see.nm aca 26 -3.063712 low …
Marissa
  • 345
  • 1
  • 5
  • 17
0
votes
0 answers

Use of geom_mosaic (ggmosaic package) for predefined fill heights

I am trying to understand how to use geom_mosaic with fill based on a proportion and the width of the bar based on the number of observations. Basically I would like to recreate the answer given by @Z.Lin on the post How to create a…
user1420372
  • 2,077
  • 3
  • 25
  • 42
0
votes
1 answer

ggmosaic plot with asymmetric offset

I have a mosaic plot generated by ggmosaic: ggplot(data.frame(a1=c(T,T,F,F), a2=c(T,F,T,F), a3=c(1,3,3,3))) + geom_mosaic(aes(weight=a3, x=product(a1,a2), fill=a1)) I would like to widen the space between the vertical bars without changing the…
user12341234
  • 6,573
  • 6
  • 23
  • 48
0
votes
1 answer

ggmosaic error message: default method not implemented for type 'list'

Trying to create a heatmap using ggmosaic, I keep getting the error Error in is.finite(x) : default method not implemented for type 'list' Searching for that error message, one answer was that "This error is because the is.infinite() and the…
lawyeR
  • 7,488
  • 5
  • 33
  • 63
1
2