0

Here is my code:

colors <- c("red", "blue")

mykey <- list(space = 'top', text = list(levels(Depression_and_BDSM_January_8_2020_14_54$Gender), col = colors),
points = list(pch = 1, col = colors))

xyplot(DASS_D ~ SSS_Total | Group, groups = Gender, data = Depression_and_BDSM_January_8_2020_14_54, layout = c(3, 1),
   panel = panel.superpose, panel.groups = function(x, y, ..., lty) {
     panel.xplot(x, y, ..., lty = lty)
     panel.lmline(x, y, ...)
   }, ylab = "Depression", xlab = "Sexual Satisfaction",
   main = "Depression and Sexual Satisfaction by \n Gender",
   key = mykey, col = colors)

Could someone explain to me how to fix this error? I am obviously still really new to the language, and any help I can get would be greatly appreciated.

  • 2
    Can you check if it is a typo. You have panel.groups = function(x, y, ..., lty) { panel.xplot(x, y, ..., lty = lty). it should be panel.xyplot – StupidWolf Jan 23 '20 at 18:30
  • Otherwise I plot without error using a dummy dataset – StupidWolf Jan 23 '20 at 18:31
  • Make sure to include sample input data to make a proper [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). It's much easier to help you with the code if we can run and test it ourselves. – MrFlick Jan 23 '20 at 19:34

0 Answers0