Search code examples
rplotlikert

Changing 'likert' standard texts


I don't know how to change the standard texts on plots created using the likert package.

To make it easy, i will just provide the sample data, as the solution probably will be the same.

library(likert)

data(pisaitems) 

items28 <- pisaitems[, substr(names(pisaitems), 1, 5) == "ST24Q"] 

l28 <- likert(items28) 

plot(l28)

The output should be as the picture below, and what i want to change are the words "Response" and "Percentage."

Output

Hope you can help!


Solution

  • Welcome to SO! I did not know the likert package but, it seems that its function plot, is based on ggplot2, so you can modify the options in ggplot2 way:

    plot(l28) +
      labs(
        x = "Another lab",                          # here you manage axis
        y = "My lab"                                # also here ("inverted "because
                                                    # it seems plot has coord_flip option)
      ) + guides(fill=guide_legend("My e title"))   # here you manage the title of the legend
    

    enter image description here