0

I tried to create a matrix of histograms using attitude dataset

library(reshape2)
library(ggplot2)
attitudeM <- melt(attitude)
g <- ggplot(attitudeM,aes(x=value))
g <- g + geom_histogram()
g <- g + facet_wrap(~variable)
g
```

i got the error message: No id variables; using all as measure variables.However I can still get the result. I'm new to r. Could you help to check what's the issue? Thanks

pythonnew
  • 23
  • 1
  • 4
  • That's not an error. It's a warning. Normally `melt()` expects there be a column that identifies each row uniquely and that value is repeated for each output row. That's not the case for the `attitude` dataset so you get that warning. But everything should work fine. You could also be explicit with `attitudeM <- melt(attitude, id.vars=NULL)` which wouldn't give that message. – MrFlick Jul 22 '20 at 22:26
  • Thanks. I tried this one. The warning message is gone. – pythonnew Jul 23 '20 at 01:43

0 Answers0