-
Notifications
You must be signed in to change notification settings - Fork 0
30 new function label converter #33
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code itself works well but I have a few comments that may be addressed:
-
When labeltype is hardcoded, uppercase letters are not accepted, see:
Lines 45 to 50 in f954789
#' df <- data.frame( #' id = 1:1000, #' labelnummer = sample(1:1000, 1000, replace = TRUE), #' soort = sample(c("REE", "WILD ZWIJN", "DAMHERT"), 1000, replace = TRUE)) #' #' labels <- label_converter(df, "id", "labelnummer", "soort", "REEKITS", 2020, "eloket") -
The df of the final example cannot be constructed because column labeltype is not present in initial dataset labels, throwing an error on this line:
Line 57 in f954789
#' mutate(labeltype = ifelse(is.na(labeltype), sample(c("REEKITS", "REEGEIT", "REEBOK", NA), 1000, replace = TRUE), labeltype)) -
Not that important, but I was wondering whether it would be better to place the function parameters in English (i.e., labelnumber instead of labelnummer, species_column instead of soort_column,...)
-
Also not that important but it may be nice to add a line after each warning that involves checking, saying that the check passed. e.g., after this warning:
1: In label_converter(df, "id", "labelnummer", "REE", "labeltype", : soort_column: REE is not a column of input >> checking if it's an allowed species
there could be a line sayingcheck passed 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I try to load the function, it seems to get stuck after line 136, not sure what is happening but it may be good to check if this also happens for you @SanderDevisscher
@soriadelva how do you mean gets stuck ? |
Fixed 🥳
Added a remark in the example. You should run an example which results in less than 1000 labels first (e.a. example 1)
Not implemented since function will be used by us only. I could translate everything to dutch if prefered (as a new issue)
Implemented, whenever the function checks something and the check is succesfully completed Additional fixes and enhancements:
|
…inbo/fistools into 30-new-function-label_converter
it's weird, when I just run the function in the code itself it keeps on getting stuck at that same line, like this: |
fixes #30