RStudio - pasting columns below each other

Viewed 5

I have a beginner question that I'm stuck on. My dataframe looks something like this:

first_column <- c("31", "22", "18", "20")
second_column <- c("No", "Handy", "Handy", "No")
third_column <- c("No", "No", "Email", "Email")
fourth_column <- c("Telex", "No", "Telex", "No")
fifth_column <- c("No", "No", "Letter", "No")
sixth_column <- c("bla", "blup", "blup", "bla")
df <- data.frame(first_column, second_column, third_column, fourth_column, fifth_column, sixth_column)

I want to merge the columns on second_column to fifth_column (character variables) into a new column, so that all values are below each other:

 new_coloum <- c("No", "Handy", "Handy", "No", "No", "No", "Email", "Email", "Telex", "No", "Telex", "No", "No", "No", "Letter", "No")

Can someone give me a hint which function I have to use? A code example would be great. Thanks!

0 Answers
Related