0

I've tried to plot a smoothScatter in, my data is correct because I can plot it normally using plot however when I use smoothScatter appears:

Error in if (!missing(bandwidth) && min(bandwidth) <= 0) stop("'bandwidth' must be strictly positive") : missing value where TRUE/FALSE needed

How can I solve this and what does that mean?

Yaz
  • 1
  • 1
  • 2
    If you want a specific answer rather than a guess / general description of the error, you'll need to provide the code and data to reproduce the error http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Hack-R Jun 16 '16 at 01:50
  • 1
    Just a guess: Try manually specifying the bandwidth. Possibly the function's attempt to select sensible bandwidth is failing. For `smoothScatter`, bandwidth seems to have the same units as your data, so if your range is 1-100, try `bandwidth=2` (smoothing over 2%-wide regions). Also be aware that x and y can have different scales, and therefore need different bandwidths: `bandwidth=c(2, 0.1)`. – bdemarest Jun 16 '16 at 02:04

2 Answers2

0

It usually means that a logical expression evaluated to NA instead of TRUE or FALSE.

This can be be caused by using the wrong data types, by missing values, or a number of other things.

If you provide a reproducible example then we can give you a specific answer.

Hack-R
  • 22,422
  • 14
  • 75
  • 131
0

set start of xlim "0" instead of other value.

Jingyi Wu
  • 13
  • 1
  • 3