Maybe someone can tell me why I'm getting an error
Error in if (df.name %in% dfs) { : the condition has length > 1
while trying to plot pie chart using function PieChart from lessR package? Here's a code I'm trying
PieChart(level, values = "%", color = "white", data = as.data.frame(mutate(data, level = case_when(`param num` < 10 ~ "low", `param num` >= 10 ~ "high"))), fill = c("blue", "violet"))
I used to run this code before and it was fine but I've changed laptop and reinstalled R & RStudio. But I'm opening the original folder with project that I had on old laptop. So that can't be the issue, can it?
Update. Example for iris dataset - getting the same mistake
library(lessR)
PieChart(sepal.length.level, values = "%", color = "white", data = as.data.frame(mutate(iris, sepal.length.level = case_when(Sepal.Length < 6 ~ "low", Sepal.Length >= 6 ~ "high"))), fill = c("orange", "green"))