0

I haven't used the likert package for a while and I've rerun my likert plot and come up with this error:

Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, : invalid value 0 for 'digits' argument

I've since tried a couple of examples I've found online and get the same error. Anyone else had this problem?

Here's the easiest example to reproduce the results.

Input =("
  Pooh    Piglet  Tigger
  3       2       4
  5       4       4
  4       2       4
  4       2       4
  4       1       5
  4       2       3
  4       3       5
  4       2       4
  5       2       4
  5       3       3
")

Data = read.table(textConnection(Input),header=TRUE)

Data$Pooh = factor(Data$Pooh,
                   levels = c("1", "2", "3", "4", "5"),
                   ordered = TRUE)

Data$Piglet = factor(Data$Piglet,
                     levels = c("1", "2", "3", "4", "5"),
                     ordered = TRUE)

Data$Tigger = factor(Data$Tigger,
                     levels = c("1", "2", "3", "4", "5"),
                     ordered = TRUE)


library(likert)

likert(Data)

Result = likert(Data)

plot(Result,
     type="bar")

Thanks

stefan
  • 90,330
  • 6
  • 25
  • 51
Sylv
  • 51
  • 6
  • Your code works fine on my machine. Running R 4.2.0 and using likert 1.3.5. – stefan Jul 12 '22 at 07:43
  • Thanks for checking for me, Stefan. Really appreciate it. I ended up restarting my computer and updating all packages. that didn't work so I removed the likert package and reinstalled it. That worked. Next time I'll try that before I bother others. Cheers. – Sylv Jul 13 '22 at 00:49

1 Answers1

0

Removing and reinstalling the likert package worked - if anyone else comes across this problem.

Cheers

Sylv
  • 51
  • 6