need finite xlim values

I was wondering if anyone can help, I keep getting this errors:

Error in plot.window(...) : need finite 'xlim' 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 am trying to do a scatterplot, I even added xlim.

plot(Stem, Lifetime, xlim="3550000000000")

Data that I am trying to use:

Lifetime
[1] 0.0041000 0.3000000 0.0052000 0.0480000 1.0000000 0.5000000 0.0003000 0.0350000 0.0019380 0.0028000 0.0021900 0.0138000
[13] 0.0793500 0.0071000 0.0710000 0.0045000 0.0810000 0.0001100 0.0203000 0.0003500 0.0000400 0.0000302 0.0002200 0.0000300
[25] 0.0004110 0.0135890 0.0001940 0.0007000 0.0037000 0.0102600 0.0003240
Stem=data$Total.stem.cell.divisions
Stem
[1] " 129,900,000,000 " " 3,550,000,000,000 " " 129,900,000,000 " " 1,168,000,000,000 " " 1,168,000,000,000 "
[6] " 1,168,000,000,000 " " 7,796,000,000 " " 7,796,000,000 " " 1,203,000,000 " " 78,400,000 "
[11] " 270,000,000 " " 31,860,000,000 " " 31,860,000,000 " " 270,900,000,000 " " 270,900,000,000 "
[16] " 9,272,000,000 " " 9,272,000,000 " " 272,000,000 " " 763,800,000,000 " " 29,260,000 "
[21] " 4,550,000 " " 6,020,000 " " 11,130,000 " " 3,150,000 " " 22,000,000 "
[26] " 342,800,000,000 " " 6,068,000,000 " " 292,200,000,000 " " 3,348,000,000 " " 585,000,000 "
[31] " 58,500,000 "

Your Stem values are characters and not numbers. R shows this by putting them in quotes. The commas used as thousnads separators are probably the problem. This can be fixed by using the function gsub() to delete the commas and using as.numeric() to convert the characters to numbers. The class() function can be used to confirm that the conversion was successful.

class(Stem)
[1] "character"
Stem <- as.numeric(gsub(",", "", Stem))
class(Stem)
[1] "numeric"

THANK YOU VERY MUCH T_T

I have been trying to solve this since Friday.

Will update

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.