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