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

add max depth? #243

Closed
timelyportfolio opened this Issue Sep 17, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@timelyportfolio

timelyportfolio commented Sep 17, 2016

It would be very helpful to have a function that provides the max depth of a list. Perhaps, this is related to #236 .

@hadley

This comment has been minimized.

Member

hadley commented Mar 3, 2017

Which I presume would look something like this:

depth <- function(x) {
  if (!is.list(x)) {
    1
  } else {
    max(map_int(x, depth)) + 1
  }
}

@hadley hadley added the feature label Mar 3, 2017

@hadley hadley closed this in 1776751 Mar 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment