You are a great teacher!!! Thank you man! God bless you....Cheers
Your content submission is amazing!!! please, keep going!
Thank you! Greetings from Mexico.
Your content submission is rocket!
Thank you! The only confusing this the final argument: TRUE ~. This is a bit counterintuitive.....
Fantastic video as always. However, why use if_else() from dplyr when there is ifelse() from base R? Sure, if_else() has an extra argument option for processing missing values, that could still be handled with the base R version without much effort too. Sometimes I think the Tidyverse over-complicates code by offering more code choices when the base R version is equivalent or nearly as good.
π always love every post and always looking forward to more. Thank Greg# R_ Super hero π¦Έπ½ββοΈ Very helpful.
This is so helpful, thank you! Can you use this approach prior to imputation of missing values in cases where you have conditional responses? E.g., in survey data certain questions may not be relevant for some participants and thus, they will not need to provide responses to a select portion of the survey. In these cases, it would be necessary to ignore their non-response and only impute data for other individuals.
I've had issues with if_else() being more restrictive with outputs and have switched to ifelse(). Let's say you want to output either a character or a number depending on your condition. For example, I want to convert all my 0 values (considering them as below LOQ) in variable_1 to "NA" and leave the rest as numeric values so I ca then use "na.exclude()": mutate(variable_2 = if_else(variable_1 == 0, "NA", variable_2) will give me an error. This same code works if I use "ifelse()" instead. I was initially using embedded if else statements and eventually realized case_when is a lot more compact.
In the case_when example, both FALSE actions (when the 2 conditions were not met) were the same (putting original hair colour) what if the FALSE action of the 2 conditions is different?
Fantastic. I'm curious then, if you like the table you've made, and want to use it in a paper or presentation, how do you export that? Is it simply copy and paste, or is there a command we can use to export the table?
@RProgramming101