Help with error message

Hey everyone,

Below is my code:

In addition: Warning messages:

1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion

2: In min(x) : no non-missing arguments to min; returning Inf

3: In max(x) : no non-missing arguments to max; returning -Inf

What can I do to fix this error message? Not sure what I’m doing wrong


plot() requires as its argument coordinates of points, each of which must be numeric, while habitat is character. Think of how you would do this with graph paper to see the problem with that—how many centimeters on the page between forest and bog on the y-axis?

dat <- data.frame(
  site =
    c("TPB", "TPB", "HBC", "HBC", "CKB", "CKB"),
  lat =
    c(42.00333, 42.00333, 42.02889, 42.02889, 42.04944, 42.04944),
  lng =
    c(73, 73, 70, 70, 71, 71),
  elev =
    c(389, 389, 8, 8, 152, 152),
  nspp =
    c(6, 5, 16, 6, 18, 14),
  habitat =
    c("forest", "bog", "forest", "bog", "forest", "bog"))

(log_nspp <- log(dat$nspp))
#> [1] 1.791759 1.609438 2.772589 1.791759 2.890372 2.639057

Looking at the last line of the reprex just above, what about the associated habitats to you want to display with the nspp numbers?

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.