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

nlapply to include metadata from data.frame #500

Open
dokato opened this issue Jun 9, 2022 · 0 comments
Open

nlapply to include metadata from data.frame #500

dokato opened this issue Jun 9, 2022 · 0 comments

Comments

@dokato
Copy link
Contributor

dokato commented Jun 9, 2022

Occasionally it happened to me that I needed to get some metadata information about the neuron that is kept in data.frame attribute. For example, I have a function that does action A if the neuron has soma, and action B if it doesn't. So far to achieve that I had to work around nlapply. I thought that including such metadata as attributes during iteration would be nice though. I.e.:

soma_radius <- function(n) {
  if (isTRUE(n$soma))
    n$d[n$d$Parent == -1,"W"]
  else 
   0
}
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