I have a dataset that has information on power plants that are operating (currently functioning) or planned (will be opened in the future). However, for a few cases, there are power plants with the status "operational & planned". These power plants already exist but will expand at a given date. I need to correct this, by doubling the entries of this outlier, i.e., when a power plant is "operational & planned" I need to keep the current row (which I will rename to operational) and create a new identical row in which the status is planned. <br />
Simply put, what I need to do is, when there is an "operational & planned" power plant, I need to split it into operational and planned by creating a new row with the same data points. I am not being able to do this with ifelse
. Could someone suggest an approach, please?
Example<br />
Firm Status Production<br />
A Operating 1000<br />
B Planned 1030<br />
C Operating 1000<br />
D Operating & Planned 1000<br />
Output<br />
Firm Status Production<br />
A Operating 1000<br />
B Planned 1030<br />
C Operating 1000<br />
D Operating 1000<br />
D Planned 1000<br />