luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
345 stars 20 forks source link

to_spatial_smooth() occurs Error in `vec_rbind() #270

Closed DrewryWang closed 4 months ago

DrewryWang commented 4 months ago

I was trying to run to_spatial_smooth() with a sfnetwork that was originally converted from a sf object, an error in `vec_rbind() occurred.
Below is the code:

Code

Link_Output_sf <- read_sf('~/link_output.shp') # the shp file is attached net <- as_sfnetwork(Link_Output_sf) smoothed_net <- to_spatial_smooth(net)

Here is detailed info about the error: Error in vec_rbind(): ! c() method returned a vector of unexpected size 12 instead of 10. ℹ In file c.c at line 414. ℹ Install the winch package to get additional debugging info the next time you get this error. ℹ This is an internal error that was detected in the vctrs package. Please report it at https://github.com/r-lib/vctrs/issues with a reprex (https://tidyverse.org/help/) and the full backtrace. Backtrace: ▆

  1. ├─sfnetworks::to_spatial_smooth(net)
  2. │ └─sfnetworks:::bind_rows_list(edges, new_edges)
  3. │ └─dplyr::bind_rows(ins)
  4. │ └─vctrs::vec_rbind(!!!dots, .names_to = .id, .error_call = current_env())
  5. └─rlang:::stop_internal_c_lib(...)
  6. └─rlang::abort(message, call = call, .internal = TRUE, .frame = frame)

Also attached is the shp file for the code: link_output_shp.zip