'I want to create a plot using plot function but faced with an error

Error in plot.window(...) : need finite 'ylim' values 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

i want to compare class with nuclear and mitochondrial diversity using a plot but not able to do it

r


Solution 1:[1]

Here is one possibility using tidyverse, although I'm unsure exactly what you want the output to be.

library(tidyverse)

df %>% 
  pivot_longer(-class, values_drop_na = TRUE) %>% 
  ggplot() +
  geom_point(aes(x = class, y = value, colour = name), size = 3.5) +
  theme_bw()

Output

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AndrewGB