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

Remove required argument n from create_node_dfs #468

Open
julianbarg opened this issue Apr 2, 2022 · 0 comments
Open

Remove required argument n from create_node_dfs #468

julianbarg opened this issue Apr 2, 2022 · 0 comments

Comments

@julianbarg
Copy link

Both create_node_df and add_node_df at the moment offer really little value to the user. Stripped to the core, a node df can be a character vector, with everything else being optional. One could just use a wrapper function to feed a character vector into create_node_df and if would work 100% of the time. The greatest offender is the required n argument for create_node_df which is nothing but an unnecessary math exercise. n is a function of the type or label argument. The way that the arguments are parsed also conceals the fact that the whole thing is nothing but a wrapper around a df with an id, type, and label column.

add_node_df should reflect the reality that users are capable of keeping track of types and labels themselves. Just allow the user to feed in a dataframe and require as a minimum no more than what is absolutely necessary to create a diagram--one column, either type or label with ID and everything else being optional. In fact, we don't need to even do any data validation here. As long as a meaningful error message is thrown, the average R user should really be able to figure out what is wrong.

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