Skip to content
Prev 173750 / 398503 Next

plotting question

Greetings all,

I have two questions.  I have a data set that is arranged in the example 
below.  I wish to obtain a plot of the performance of each ID over Year 
on v1.  It's not clear how I set this up? 

ID  Year   V1  
1   1980    1  
1   1981    2 
1   1982    6
1   1983    4
2   1980    5
2   1981    5
2   1982    5
2   1983    6

Also,I would like to transpose the data to have the variable across the 
columns such as

ID   v1980   v1981 v1982 v1983
1       1       2      6   4
2       5       5      5   6


Is there a straightforward way to do this in R?

Thanks in advance,

David