box of two series

hello

    boxplot(c(moustaches$norm,moustaches$unif),col=c("red","green"),
    horizontal=TRUE,names=c("n","u"),show.names=TRUE,
    notch = TRUE,main="norm,unif")

only shows one boxplot instead of two, and also therefore an error with the show.names

i can't understand why

the error message is :

Error in attr(groups, "names") <- names : 
  'names' attribute [2] must be the same length as the vector [1]
library(tidyverse)

moustache <- data.frame(norm=rnorm(100),
           unif=runif(100))

moustachelong <- moustache %>% pivot_longer(cols = everything(),
                                                  names_to = "split_group",
                                                  values_to = "values")

boxplot(values ~ split_group,data=moustachelong,
        col=c("red","green"),
        horizontal=TRUE,show.names=TRUE,
        notch = TRUE,main="norm,unif")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.