![](/img/trans.png)
[英]R: Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'
[英]Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'
我嘗試在R中繪制方差圖。運行以下代碼時:
library(geoR)
Data = as.geodata(Data2, coords.col=1:2, data.col=3)
VG = variog(Data2,estimator.type="classical")
VG.fit = variofit(VG, ini.cov.pars =c(0.095,1.4), cov.model="gaussian", fix.nugget=FALSE, nugget=0.065)
plot(VG.fit)
我收到一個錯誤:
xy.coords(x,y,xlabel,ylabel,log)中的錯誤:“ x”是一個列表,但沒有組件“ x”和“ y”
在這種情況下, VG
是variogram
類,而VG.fit
是variomodel
和variofit
類。 有一個情節方法variogram
,但不適用於variomodel
或variofit
。 閱讀一些文檔后,您似乎應該首先繪制variogram
圖:
plot(VG)
lines(VG.fit)
如果只需要擬合線,則將pch = ""
添加到繪圖函數作為參數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.