Error in NextMethod(.Generic) : cannot assign 'tsp' to a vector of length 0

Then to advance the discussion, post a complete reprex that will produce the identical error. Start from a fresh R session to avoid contamination of namespace.