I have two columns (symtpom_onset; and test_positive.
So now I want to transfer the information of test_positive to symptom_onset column. With condition, if symptom_onset is missing value.
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
In here, I have A, B colums by date. my concept is if A missing value then B - 21. I wrote the function:
data2 <- data1 %>% mutate(A=ifelse(is.na(A)==TRUE, B-21, B))
However, the result showed not format date by A colums.
Pls help me to solove?
As @andresrcs suggests, your Reproducible Example should include some relevant data in text form (not just a screenshot from your monitor) because otherwise in order to help you someone has to type that data in to demonstrate a solution.
HTH
Thank for your support.
I make at step # Check that the ifelse logic is correct
so the result is not logic, BUT incuba.data1 is data.frame. I checked it
Pls, help me.