2

I am trying to use a QQ plot to determine if my data are normally distributed. I am using the mtcars dataset for practice. When making a QQ plot, I keep getting the error below:

Warning messages:
1: The following aesthetics were dropped during statistical transformation: sample
ℹ This can happen when ggplot fails to infer the correct grouping structure in the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical variable into a factor? 
2: The following aesthetics were dropped during statistical transformation: sample
ℹ This can happen when ggplot fails to infer the correct grouping structure in the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical variable into a factor?

The plot itself prints out, actually looks totally reasonable, and matches my output in Excel. However, I don't want to have this error message keep popping up as it's a bit annoying. I also worry I am missing something that could be important. Weirdly, when I run the examples listed on the help tab for ggqqplot, I get the same error. Does anyone know what might be going on? Here is my code for reference:

library("ggpubr")
ggqqplot(mtcars,x="mpg")

enter image description here

Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
  • 1
    I can't reproduce your problem. The code runs without errors or warnings. In any case, these are warnings rather than errors, and the plot is correct (it's the same as the one I get) – Allan Cameron Nov 08 '22 at 23:00
  • Hmm... odd! Thanks for checking I appreciate it. – Alison Williams Nov 09 '22 at 16:38
  • I can recreate the problem. Could you post your sessionInfo(). I have ggpubr_0.4.0 ggplot2_3.4.0 – Russ Hyde Nov 17 '22 at 12:54
  • Sorry all-- now I cannot reproduce the problem! I have absolutely no idea why I got the warning a few days ago, and why I don't have it now. I haven't installed any new versions of packages or changed my dataset. It's a mystery. – Alison Williams Nov 29 '22 at 20:19

0 Answers0