I am working with a large dataset (52.769 rows). I need to compute the bandwidth for GWR using dm. calib from GWmodel package. When I run the code, I get the following error: Error: std::bad_alloc and nothing else.
How do I fix this?
This is my code:
xy <- st_coordinates(dt)
spdf <- as(dt, "Spatial")
dm.calib <- gw.dist(dp.locat = coordinates(spdf))
I tried to compute manually, but unfortunately, there was still an error. This is my code
coordinates <- data.frame(x = dt$xcoord, y = dt$ycoord)
dm.calib <- as.matrix(dist(coordinates))
dm.calib
New contributor
Eos Elinor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.