I am trying to merge one column into another column. I want to merge the column "type0" into "type", while put the "type0" values to "days", with corresponded type = 0.
The original dataset would be like:
|id|type|days|type0|
|--|-----|----|----|
|1|1|10|10|
|1|2|3|5|
|2|1|2|6|
|2|2|6|8|
where type0 indicates that the subject has experienced x days with type 0 (i.e. subject 1 experienced 10 days of type 0)
The expected outcome would be like:
|id|type|days|
|--|-----|----|
|1|1|10|
|1|2|3|
|1|0|10|
|2|0|5|
|2|1|2|
|2|0|6|
|2|2|6|
|2|0|8|
Thank you all!