Dear all, all data I am talking about can be found at <http://www.metaanalyse.de/tmp/test.dat>. The R-code is located at <http://www.metaanalyse.de/tmp/test.R> I'd like to plot the frequencies for status against year. Typing table(tmp$year) it can be simple seen that some years are missing, e.g. 1975-1978, 1981 etc. Using xyplot to display the data I do not like the fact that some of the years are missing (due to missing observations, of course...). Is there any sensible way to extend the data frame (or the table or xyplot?) with the years that are missing? In other words: in need a continuous x-axis ranging from 1974 to 2004. TIA, Bernd
On 21 Sep 2005 at 9:18, Chuck Cleland wrote:> Bernd: > I think you will get what you want if you convert year from a > factor > to numeric: > > library(lattice) > tmp <- read.table("http://www.metaanalyse.de/tmp/test.dat") > xyplot(Freq~as.numeric(as.character(year)),group=status,data=data.fram > e(table(tmp)))Dear Chuck, yes, that's it! Thank's a lot, Bernd -- Bernd Weiss, M.A. University of Cologne / Research Institute for Sociology Greinstr. 2 / D-50939 Cologne / Germany E-Mail: <bernd.weiss at uni-koeln.de> URL: <http://www.uni-koeln.de/wiso-fak/fisoz/>