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

Pass information about current cluster to aggregation functions #55

Open
lazappi opened this issue Jun 10, 2020 · 1 comment
Open

Pass information about current cluster to aggregation functions #55

lazappi opened this issue Jun 10, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@lazappi
Copy link
Owner

lazappi commented Jun 10, 2020

The node aes aggregation functions currently have no information about the cluster they are working on. This makes it impossible to perform some useful aggregations such as proportions (raised in #54).

One possible solution is to check if the aggregation function has a ... argument. If yes this could be used to pass arguments (or a list) with details of the cluster. Something like:

if ("..." in names(as.list(args(col_aggr_fun)))) {
    cluster_info = list(res = res, cluster = cluster, size = size)
    node_data[aggr_col_name] <- col_aggr_fun(clust_meta, CLUSTER = cluster_info)
}
@lazappi lazappi added the enhancement New feature or request label Jun 10, 2020
@lazappi
Copy link
Owner Author

lazappi commented Jun 12, 2020

This approach doesn't work because you can't be sure what the aggregation function will do with .... For example max() uses it to accept all values to find the max of which causes problems when it gets an extra list.

Still think this would be useful but not sure how to do it.

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

No branches or pull requests

1 participant