bash$ tcsh Displaying on melody.rem.cmu.edu:0.0 [famine]~/classes/401/S% S S-PLUS : Copyright (c) 1988, 2000 MathSoft, Inc. S : Copyright Lucent Technologies, Inc. Version 6.0 Release 1 for Linux 2.2.12 : 2000 Working data will be in .Data > !ls ~/www/401/data/chil* Displaying on melody.rem.cmu.edu:0.0 /home/FAMINE/brian/www/401/data/child.dat > !cp ~/www/401/data/chil* . Displaying on melody.rem.cmu.edu:0.0 > !cat child.dat Displaying on melody.rem.cmu.edu:0.0 Age 1920 1930 1940 1945 1950 1955 1960 15 0 0 0 0 0 0 0 20 7 9 13 17 19 18 13 25 39 48 59 60 53 45 39 30 67 75 82 82 75 68 NA 35 76 83 87 88 83 NA NA 40 78 86 89 90 NA NA NA 45 NA 86 89 NA NA NA NA > child _ read.table("child.dat") > child V2 V3 V4 V5 V6 V7 V8 Age 1920 1930 1940 1945 1950 1955 1960 15 0 0 0 0 0 0 0 20 7 9 13 17 19 18 13 25 39 48 59 60 53 45 39 30 67 75 82 82 75 68 NA 35 76 83 87 88 83 NA NA 40 78 86 89 90 NA NA NA 45 NA 86 89 NA NA NA NA > child _ read.table("child.dat",header=T) > child Age X1920 X1930 X1940 X1945 X1950 X1955 X1960 1 15 0 0 0 0 0 0 0 2 20 7 9 13 17 19 18 13 3 25 39 48 59 60 53 45 39 4 30 67 75 82 82 75 68 NA 5 35 76 83 87 88 83 NA NA 6 40 78 86 89 90 NA NA NA 7 45 NA 86 89 NA NA NA NA > matplot(1:7,child,type=") Continue string: Continue string: Interrupt Interrupt Interrupt> > > > matplot(1:7,child,type="l") Error: Non-numeric vector Error in par > as.list(child) $Age: [1] 15 20 25 30 35 40 45 $X1920: [1] 0 7 39 67 76 78 NA $X1930: [1] 0 9 48 75 83 86 86 $X1940: [1] 0 13 59 82 87 89 89 $X1945: [1] 0 17 60 82 88 90 NA $X1950: [1] 0 19 53 75 83 NA NA $X1955: [1] 0 18 45 68 NA NA NA $X1960: [1] 0 13 39 NA NA NA NA > matplot(1:7,as.matrix(child),type="l") > matplot(1:7,as.matrix(child),type="l",lty=1:7) > matplot(child$age,as.matrix(child)[,-1],type="l") Error: Non-numeric vector Error in par > matplot(child$age,as.matrix(child[,-1]),type="l") Error: Non-numeric vector Error in par > matplot(child$Age,as.matrix(child)[,-1],type="l") > legend(locator(),legend=names(child)[-1],type="l") > matplot(child$Age,as.matrix(child)[,-1],type="l") > legend(locator(),legend=names(child)[-1],lty=1:7) > dev.off() null device 1 > child Age X1920 X1930 X1940 X1945 X1950 X1955 X1960 1 15 0 0 0 0 0 0 0 2 20 7 9 13 17 19 18 13 3 25 39 48 59 60 53 45 39 4 30 67 75 82 82 75 68 NA 5 35 76 83 87 88 83 NA NA 6 40 78 86 89 90 NA NA NA 7 45 NA 86 89 NA NA NA NA > !cat child.dat Displaying on melody.rem.cmu.edu:0.0 Age 1920 1930 1940 1945 1950 1955 1960 15 0 0 0 0 0 0 0 20 7 9 13 17 19 18 13 25 39 48 59 60 53 45 39 30 67 75 82 82 75 68 NA 35 76 83 87 88 83 NA NA 40 78 86 89 90 NA NA NA 45 NA 86 89 NA NA NA NA > as.vector(child) $Age: [1] 15 20 25 30 35 40 45 $X1920: [1] 0 7 39 67 76 78 NA $X1930: [1] 0 9 48 75 83 86 86 $X1940: [1] 0 13 59 82 87 89 89 $X1945: [1] 0 17 60 82 88 90 NA $X1950: [1] 0 19 53 75 83 NA NA $X1955: [1] 0 18 45 68 NA NA NA $X1960: [1] 0 13 39 NA NA NA NA > unlist(child) Age1 Age2 Age3 Age4 Age5 Age6 Age7 X19201 X19202 X19203 X19204 X19205 X19206 15 20 25 30 35 40 45 0 7 39 67 76 78 X19207 X19301 X19302 X19303 X19304 X19305 X19306 X19307 X19401 X19402 X19403 NA 0 9 48 75 83 86 86 0 13 59 X19404 X19405 X19406 X19407 X19451 X19452 X19453 X19454 X19455 X19456 X19457 82 87 89 89 0 17 60 82 88 90 NA X19501 X19502 X19503 X19504 X19505 X19506 X19507 X19551 X19552 X19553 X19554 0 19 53 75 83 NA NA 0 18 45 68 X19555 X19556 X19557 X19601 X19602 X19603 X19604 X19605 X19606 X19607 NA NA NA 0 13 39 NA NA NA NA > as.vector(unlist(child)) [1] 15 20 25 30 35 40 45 0 7 39 67 76 78 NA 0 9 48 75 83 86 86 0 13 59 82 [26] 87 89 89 0 17 60 82 88 90 NA 0 19 53 75 83 NA NA 0 18 45 68 NA NA NA 0 [51] 13 39 NA NA NA NA > names(child) [1] "Age" "X1920" "X1930" "X1940" "X1945" "X1950" "X1955" "X1960" >