This can be done with melt
from data.table
which can take multiple columns in the measure
by specifying the pattern
library(data.table)#v1.9.6+
melt(setDT(df1), measure=patterns('Title', 'Year', 'Rating'),
value.name=c('Title', 'Year', 'Rating'))[,variable:=NULL][]
# Title Year Rating
#1: Movie 1 1997 6.7
#2: Movie 2 1987 8.2
#3: Movie 3 2009 7.1
data
df1 <- structure(list(Title = "Movie 1", Year = 1997L, Rating = 6.7,
Title = "Movie 2", Year = 1987L, Rating = 8.2, Title = "Movie 3",
Year = 2009L, Rating = 7.1), .Names = c("Title", "Year",
"Rating", "Title", "Year", "Rating", "Title", "Year", "Rating"
), class = "data.frame", row.names = c(NA, -1L))