Let I have such a data frame(df):
df:
header1 header2
------ -------
45 76
54 89
- 12
45 32
12 34
- 5
45 34
65 54
I want to get such a dataframe
header1 header2
------ -------
45 76
54 89
- -
45 32
12 34
- -
45 34
65 54
Namely I want to replace values in header2 columsn with "-", which rows of column header1 have "-" values.
How can I do that in R? I will be very glad for any help. Thanks a lot.