Don't understand how to finite 'ylim' values

New to R and trying to plot the values of "diff dry" to the time axis but it says I need finite "ylim" values but I have no idea what it means or how to fix it. All values are above 0. This code has worked for similar data sets so shouldn't be anything wrong with it?

plotS10V<-plot(c(R1$Diff dry ,R2$Diff dry ,R3$Diff dry )~c(R1$Time,R2$Time,R3$Time),type="n",ann=F)
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

The data for this set is
Replica/Time/Diff dry (g)
1/-1/0,0034
1/0/0,0026
2/-1/0,002
2/0/0,0017
3/-1/0,0019
3/0/0,0064

diff dry is probably not numeric but character, it seems commas are used instead of full stop as the marker for decimal place, this is non standard., but you can replace the decimal, and convert to an actual numeric type.

somedata <- read_delim("Replica/Time/Diff dry (g)
1/-1/0,0034
1/0/0,0026
2/-1/0,002
2/0/0,0017
3/-1/0,0019
3/0/0,0064",delim="/")


plot(somedata$Time,
     somedata$`Diff dry (g)`)

library(tidyverse)
somedata2 <- mutate(somedata,
                    `Diff dry (g)` = str_replace_all(`Diff dry (g)`,
                                                     ",",".") |>
                      readr::parse_number())

plot(somedata2$Time,
     somedata2$`Diff dry (g)`)

That fixed the issues, thank you!

This topic was automatically closed 7 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.