[traits.build adding studies functions] enchancements to move_values_to_new_trait
function
#162
Labels
enhancement
New feature or request
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
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.
The text was updated successfully, but these errors were encountered: