我想繪製data.frame,我的問題是,出現以下錯誤:半徑誤差(...)需要有限「XLIM價值觀
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 xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
5: In min(x) : no non-missing arguments to min; returning Inf
6: In max(x) : no non-missing arguments to max; returning -Inf
這是我的代碼:
CO2.data = read.table("962RecordedDataCO2.txt",sep=";", stringsAsFactors=F)
x = CO2.data$V1
y = CO2.data$V2
plot(x,y,type="l")
我想這個問題可能是,x和y是字符值,這不能被繪製(X是日期和時間,例如16.06.2015 20:07:00
和y只是一個雙值像0,0300
)。但我不能真正做到y = as.numeric(CO2.data$V2)
因爲那麼每值NA。
的str(CO2.data)
結果是:
'data.frame': 24479 obs. of 2 variables:
$ V1: chr "15.06.2015 00:01:00" "15.06.2015 00:02:00" "15.06.2015 00:03:00" "15.06.2015 00:04:00" ...
$ V2: chr "0,0200" "0,0200" "0,0200" "0,0200" ...
能否請你把'STR(CO2.data)'的結果。 – user1436187
當然,我說在我原來的職位。 – Borsi