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!