\begin{Schunk}
\begin{Sinput}
 gpa5 <- reshape(gpa, varying = list(paste0("job", 2:7), paste0("gpa", 2:7)), 
                  v.names = c("job", "gpa"),  direction = "long", 
                  idvar = "student", times = 7:2) 
 gpa5 <- gpa5[order(gpa5$student, gpa5$time), ]
 head(gpa5, 12)
\end{Sinput}
\begin{Soutput}
    student    sex highgpa admitted time     job gpa
1.2       1 female     2.8      yes    2 2 hours 3.3
1.3       1 female     2.8      yes    3 2 hours 3.0
1.4       1 female     2.8      yes    4 2 hours 3.0
1.5       1 female     2.8      yes    5 2 hours 3.0
1.6       1 female     2.8      yes    6 2 hours 2.1
1.7       1 female     2.8      yes    7 2 hours 2.3
2.2       2   male     2.5       no    2 2 hours 2.8
2.3       2   male     2.5       no    3 2 hours 3.0
2.4       2   male     2.5       no    4 2 hours 2.6
2.5       2   male     2.5       no    5 2 hours 2.6
2.6       2   male     2.5       no    6 3 hours 2.5
2.7       2   male     2.5       no    7 2 hours 2.2
\end{Soutput}
\end{Schunk}
