0

I am trying to do geographically weighted lasso (GWL) in packgae gwrr. But get this error:

 Error in W.i %*% X[-i, ] : 
  requires numeric/complex matrix/vector arguments

The code is: > col.gwl <- gwl.est(NPb~NAl2O3, locs, df, "exp")

When I checked the error, the answer online was about the factor/character in the dataframe. And also the matrix as.matrix. But the variables in my dataframe df are all numeric.

Can someone help me to solve this issue? Thanks a million!

Peter
  • 11,500
  • 5
  • 21
  • 31
Fian
  • 1
  • Yes. It showed > class(locs) [1] "matrix" – Fian Jul 20 '20 at 13:52
  • 1
    I'd suggest posting your data objects inside your code using the ```dput()``` function. This will aid [reproducibility](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example), which makes it easier for the community to help you. – xilliam Jul 20 '20 at 13:58

0 Answers0