Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A error in "use krige" #69

Open
OrdinarySK opened this issue May 9, 2020 · 7 comments
Open

A error in "use krige" #69

OrdinarySK opened this issue May 9, 2020 · 7 comments

Comments

@OrdinarySK
Copy link

kr.lst <- krige(formula = lst~longtitude+latitude+slope+evelation, data=sa, newdata=grid.grid, model=fvlst)

error information:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘krige’ for signature ‘"formula", "missing"’

my sa contains longtitude,latitude,slope,evelation,lst and so on column
grid.grid contains longtitude,latitude
fvlst is fit.variogram result

@edzer
Copy link
Member

edzer commented May 9, 2020

Try not naming the arguments, as in

krige(lst~longtitude+latitude+slope+evelation, sa, grid.grid, model=fvlst)

@OrdinarySK
Copy link
Author

I tried again as you said. error:"Error in eval(predvars, data, env) : not find object 'slope' "
“slope” is include in sa, why such error occurs?

@edzer
Copy link
Member

edzer commented May 13, 2020

It needs to be in grid.grid as well.

@OrdinarySK
Copy link
Author

I don't quite understand.
user manual example
krige(log(zinc)~1, meuse, meuse.grid, model = m)
The example data "meuse and meuse.grid",
meuse.grid as a GRID data not contains zinc, zinc is include in meuse. why is this ok?
As far as i am concerned, In my data, "sa" is the sampling points, including other environmental covariates and target variable. “grid.grid” is the gridded study area GRID data, only contains longtitude and latitude. why "slope" needs to be in "grid.grid" as well?
So, Is this my idea wrong?

@edzer
Copy link
Member

edzer commented May 13, 2020

slope is on the RHS of the formula, meaning it is a predictor; for prediction, you need to have all predictors at prediction locations.

@OrdinarySK
Copy link
Author

Okay, I understand roughly, thank you.

@OrdinarySK
Copy link
Author

Excuse me, I have the other question.
How do I determine the size of the parameter range when using fit.lmc.
Because of my three target variables have different range base on “Spherical” model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants