Pretty sure this hasn't been asked.
> have
x1 x2 x3
1 Apple Banana Potassium
2 Apple Banana Thiamine
> want
x1 x2 x3
1 Apple Banana Potassium / Thiamine
x1 and x2 are like ID variables and x3 is a categorical value. A similar question has been asked here: Condensing multiple observations on the same individual into a single row, adding multiples as new columns but it results in additional columns with NA values for observations where categorical values are unavailable. I tried to convert NA values to " " and pasting them together. The result is not desirable. Looks like this when there are multiple NA values replaced by blanks. "Potassium / / / "