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

[traits.build adding studies functions] enchancements to move_values_to_new_trait function #162

Open
ehwenk opened this issue Aug 18, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@ehwenk
Copy link
Collaborator

ehwenk commented Aug 18, 2022

The function move_values_to_new_trait has two tweaks required to be cleaner.

First, it currently requires that we have a separate line of code before running the trait, that creates a new trait, as in

mutate(new_trait = NA_character_)

I haven't succeeded in coding this into the function. It needs to go in together with a T/F argument, that defaults to adding this line, but it could call upon an existing trait. For instance there are times where some values are mapped across to an existing trait.

Second, there is a problem is you have a string of values that includes an NA. This will occur if you want to leave the original trait value column with blanks. For I use "" in the list, as in c("parasitic", "", "saprophyte"), but this shows up as a blank column in the excluded data table. I tried adding an na_if line at the end of the function,

data[[original_trait]] = ifelse(data[[original_trait]] == "", NA, data[[original_trait]])

but it isn't working.

ehwenk referenced this issue in traitecoevo/austraits.build Aug 18, 2022
Still problems as described in issue #612
@ehwenk
Copy link
Collaborator Author

ehwenk commented Aug 23, 2022

And third, we should incorporate the "to lower case" function as part of this.

@ehwenk ehwenk added the enhancement New feature or request label Jul 31, 2024
@ehwenk ehwenk changed the title enchancements to move_values_to_new_trait function [minor enhancements] enchancements to move_values_to_new_trait function Jul 31, 2024
@ehwenk ehwenk transferred this issue from traitecoevo/austraits.build Jul 31, 2024
@ehwenk ehwenk changed the title [minor enhancements] enchancements to move_values_to_new_trait function [traits.build adding studies functions] enchancements to move_values_to_new_trait function Jul 31, 2024
@ehwenk ehwenk added this to AusTraits Jul 31, 2024
@ehwenk ehwenk moved this to Backlog in AusTraits Jul 31, 2024
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
Status: Backlog
Development

No branches or pull requests

1 participant