0

I want to render the following plot.

```{r qqGehalt, echo=FALSE, fig.cap= "Q-Q-Plot: Verteilung Gehalt (in Euro) je Region im Vergleich zur Normalverteilung", fig.dim= c(9,4)}
ggplot(F22_samp,aes(sample= wage_eur)) + geom_qq(shape=1) + geom_qq_line(linetype = 1,color="red") + 
  xlab("Theoretische Verteilunng") +
    ylab("Stichprobe") +
  facet_wrap(vars(nationality_region)) 
```

I get no error while executing the call but when I render it.

 Quitting from lines 68-72 (Test_DataAna.Rmd) 

Error in `combine_vars()`:
! At least one layer must contain all faceting variables: `club_position_summ`.
* Plot is missing `club_position_summ`
* Layer 1 is missing `club_position_summ`
* Layer 2 is missing `club_position_summ`
Backtrace:
  1. rmarkdown::render(...)
  2. knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  3. knitr:::process_file(text, output)
  6. knitr:::process_group.block(group)
  7. knitr:::call_block(x)
     ...
 28. layout$setup(data, plot$data, plot$plot_env)
 29. ggplot2 (local) f(..., self = self)
 30. self$facet$compute_layout(data, self$facet_params)
 31. ggplot2 (local) f(...)
 34. ggplot2::combine_vars(data, params$plot_env, vars, drop = params$drop)
Ausführung angehalten

Does anybody know, what might cause the problem. I really appreciate any help.

  • 5
    Are you sure the error message is from the code you posted? It seems weird to throw an error message about the `club_position_summ` variable not being present, while the indicated facetting variable is `nationality_region`. Maybe `nationality_region` is a global variable and not a column in the data? It's hard to judge without enough information to reproduce the error. – teunbrand Aug 25 '22 at 12:11
  • It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick Aug 25 '22 at 13:37

0 Answers0