warning messages in running beeswarm plots

Hi, I have a trouble in running beeswarm package.
Even if I had a plot results, I saw warning messages as follows

This is a code:

install.packages('beeswarm')
install.packages('RColorBrewer')
library(beeswarm)
library(RColorBrewer)
setwd("C:/Users/pjh74/Desktop/exercise")
titanic <- read.csv("https://static-resources.zybooks.com/static/titanic.csv", fileEncoding = "UTF-8-BOM")
beeswarm(fare ~ deck, data = titanic,
log = TRUE, pch = 16, col = rainbow(8),
main = "Fares paid by passengers of the Titanic by deck")

And these are warning messages:

1: In beeswarm.default(split(mf[[response]], f), pwpch = pwpch, pwcol = pwcol, :
values <= 0 omitted from logarithmic plot
2: In xy.coords(x = x, y = y, recycle = TRUE, log = log) :
12 y values <= 0 omitted from logarithmic plot
3: In xy.coords(x = x, y = y, recycle = TRUE, log = log) :
1 y value <= 0 omitted from logarithmic plot
4: In xy.coords(x = x, y = y, recycle = TRUE, log = log) :
2 y values <= 0 omitted from logarithmic plot

Could anybody help me to understand the messages?

This is to do with what logarithms are, and the domain of the log function
Logarithm - Wikipedia

log is only defined on positive numbers.
see

5:-1
#[1]  5  4  3  2  1  0 -1

log(5:-1)
#[1] 1.6094379 1.3862944 1.0986123 0.6931472 0.0000000      -Inf       NaN

Thank you so much. I appreciate it!!

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.