-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
When I try to plot only 1 point, the following error message appears:
Error in if (sdx == 0) sdx <- 1 : missing value where TRUE/FALSE needed
The issue relies in the wordlayout functions, when computing the standard deviation:
sdx <- sd(x, na.rm = TRUE)
sdy <- sd(y, na.rm = TRUE)
If x and y refer to only 1 point, sdx and sdy result in NA and this causes the above error message.
Steps to reproduce the issue:
library(wordcloud)
df = data.frame(id = 'sample', x = 0.2, y = 0.4)
plot(x = df$x, y = df$y)
textplot(x = df$x, y = df$y, words = df$id, new = F)
Informations about system:
OS: Debian 9.3 - linux-image-4.9.0-5-amd64
R version 3.4.3 (CRAN Repository)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels