I have a dataframe
Fruit Amount Price
Apple 2 20
Banana NA 59
Grapes NA NA
I want to create a "key" column by concatenating them with ~ between the columns. Output I need -
- Apple~2~20
- Banana~~59
- Grapes~~
Currently using paste(fruit, amount,price, sep="~", collapse=NULL)
But I get the outputs with NA-
- Banana~NA~59
- Grapes~NA~NA Any help on any other function that can be used ?