R - confused about the axis scaling

49 views Asked by At
data = read.table("Þjóðin_Kyn.txt",
+                   fill=TRUE,sep="\t",
+                   header=TRUE
+                   )
> plot(data[(1:10),10],
+      data[(1:10),3],
+      type="o",
+      main="Þjóð - Kyn",
+      xlab="Ár",
+      ylab="Aldrei (%)",
+      xaxp=c(2005,2014,9),
+      yaxp=c(0,100,50),
+      ylim=c(0,100))
> print( data[(1:10),10] )
 [1] 2005 2006 2007 2008 2009 2010 2011 2012 2013
[10] 2014
> print( data[(1:10),3] )
 [1] 78%    80.90% 82.90% 83.10% 91.40% 89%   
 [7] 82%    91%    91%    90%   
18 Levels: 67.30% 70% 71.40% 71.70% 72% ... 91.40%

This is my code when executed. And this is the plot produced:

plot

Why does the y value only range from 8 to 20 when the print command shows percentages in the 80-90 range?

0

There are 0 answers