Re: [R] ggplot get rid of unused/empty facets

2020-04-30 Thread PIKAL Petr
f Ivan Calandra > Sent: Thursday, April 30, 2020 12:28 PM > To: r-help@r-project.org > Subject: Re: [R] ggplot get rid of unused/empty facets > > Dear Petr, > > This is not a ggplot2 solution, but you could just remove the NA rows and > drop the levels of vzorek: > met2 <

Re: [R] ggplot get rid of unused/empty facets

2020-04-30 Thread Ivan Calandra
Dear Petr, This is not a ggplot2 solution, but you could just remove the NA rows and drop the levels of vzorek: met2 <- met[complete.cases(met), ] met2$vzorek <- droplevels(met2$vzorek) But I guess you already thought about that...! Ivan -- Dr. Ivan Calandra TraCEr, laboratory for Traceology an

[R] ggplot get rid of unused/empty facets

2020-04-30 Thread PIKAL Petr
Dear all I seek some help how to remove unused facets in ggplot Here is my code p <- ggplot(met, aes(x=datum, y=lsp)) p+geom_point(size=5)+geom_line()+facet_grid(.~vzorek) As you can see, there are some empty facets. Is there any reasonably simple way how to automatically get rid of empty facets