Suppose I have data-frame x. It has column "A" and "B".
A B
a b a b
c d c d
e f e f
a b a b
a b
a b a b
a b a b
a b
a b
a b
a b
I want to display something like this.
A B
a b a b
c d c d
e f e f
a b a b
a b a b
a b a b
a b a b
a b a b
a b a b
a b a b
a b a b
Basically I want to do filter on x.A for value "a b", so that I can get exact same value on x.B. For column B I have only "a b" and " " values for that. I want to convert " " to "a b" in B column.
I have tried using gsub, sub, filter with regex but after cleaning data if I export this .csv file in excel I am not getting correct output what I want.