Add formatting functionality to package - #8
Conversation
|
Hi Yeon, Thanks a lot! Nice features.
Carlos |
|
Yup make sense wil do that. thank you! |
also add a condition to return formatting outputs when there is nothing to mask
|
|
||
| # IF nothing to be masked, return input_vector with formatting. | ||
| # This ensure vectors that need a masking procedure will be in a string format. | ||
| if(all(input_vector >= threshold | input_vector < 1)){ |
There was a problem hiding this comment.
Added a condition to also return formatting values when a vector contain 0 value to mask.
|
hi @CarlosPoses, I made a new push including:
|
|
@CarlosPoses can you look at the above please? Preferably we would merge this into main |
| ## If the input is an exception left as is | ||
| if(length(input_vector) == 1 & is_exception(input_vector[1])) return(input_vector) | ||
| if(length(input_vector) == 1 & is_exception(input_vector[1])) { | ||
| return(formatC(input_vector, big.mark = big_mark_seperator)) |
There was a problem hiding this comment.
This crashes for some values of is_expection = TRUE. Concretely formatC seems to not support NA and NaNs
expected value of mask_vector is character now, so reflected in tests
|
Hi @Yeon-Choi-git , I just look at it, sorry for the long waiting time. The function crashes when running the tests (you can source it tests/testthat/test-interval-masking.R' and it's related to the new formatting.
Thanks! Carlos |
Hi @CarlosPoses,
I made some minor updates to your
mask_vector()so that:Please see an example.