\begin{Schunk}
\begin{Sinput}
 gpa2 <- reshape(gpa, direction = "long",
          varying = list(c("job1", "job2", "job3", "job4", "job5", "job6"),     
          c("gpa1", "gpa2", "gpa3", "gpa4", "gpa5", "gpa6")), 
          v.names = c("job", "gpa"),  
          idvar = "student") 
 head(gpa2, 10)
\end{Sinput}
\begin{Soutput}
     student    sex highgpa admitted time     job gpa
1.1        1 female     2.8      yes    1 2 hours 2.3
2.1        2   male     2.5       no    1 2 hours 2.2
3.1        3 female     2.5      yes    1 2 hours 2.4
4.1        4   male     3.8       no    1 3 hours 2.5
5.1        5   male     3.1      yes    1 2 hours 2.8
6.1        6 female     2.9       no    1 2 hours 2.5
7.1        7   male     2.3      yes    1 3 hours 2.4
8.1        8 female     3.9      yes    1 2 hours 2.8
9.1        9   male     2.0     <NA>    1 2 hours 2.8
10.1      10   male     2.8      yes    1 2 hours 2.8
\end{Soutput}
\end{Schunk}
