Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new_rtoi() with records produces "stack usage close to limit" #11

Open
thechibo opened this issue Aug 12, 2022 · 0 comments
Open

new_rtoi() with records produces "stack usage close to limit" #11

thechibo opened this issue Aug 12, 2022 · 0 comments

Comments

@thechibo
Copy link

Hello,

The function new_rtoi() calls itself when the records argument is supplied, producing a stack usage error. I post below an indicative solution (my comments start with ###).

#' @rdname new_rtoi
#' @aliases character,sf,character,character,records
setMethod(
  "new_rtoi",
  signature(
    name = "character",
    region = "sf",
    rtoi_path = "character",
    db_path = "character",
    records = "records",
    size = "missing"
  ),
  function(name, region, rtoi_path, db_path, records) {
    newobj <- new_rtoi(name, region, rtoi_path, db_path, records = records) ### remove records = records
    newobj$records <- records ### add this line
    newobj$size <- 0
    write_rtoi(newobj)
    return(newobj)
  }
)

Best Regards,
John

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant