[R] Strange problems with lattice plots

Wladimir Eremeev wl at eimb.ru
Sun Jul 17 05:55:40 CEST 2005


Yes!!! I have overcome it!

The solution is

xyplot((V_A3/25)~year|factor(month),
        strip=strip.custom(factor.levels=c(month.name,"Annual mean",
              "Annual integral","Integral (Jan-Mar)","Integral (Apr-Jun)","Integral (Jul-Sep)","Integral (Oct-Dec)",
              
         and so on...


Sorry to disturb.
         
WE> Dear r-help,
WE> I need to draw some lattice plots and have stuck in strange problems.
   
WE>    I have a data frame of 405 rows:
>> str(dframe)
WE> `data.frame':   405 obs. of  4 variables:
WE>  $ year : num  1990 1990 1990 1990 1990 1990 1990 1990 1990 1990 ...
WE>  $ month: num  1 2 3 4 5 6 7 8 9 10 ...
WE>  $ V_A2 : num  NA NA NA NA NA ...
WE>  $ V_A3 : num  NA NA NA NA NA ...

WE> Variable month changes from 1 to 27 as the data frame includes monthly
WE> measurements and some aggregations of them.
WE> Variable year varies from 1990 to 2004.
WE> Variables V_A2 and V_A3 contain floating point values and several NAs (as
WE> sometimes measurements were unavailable).

WE> I draw plots:

WE> xyplot((V_A3/25)~year|
WE>        factor(month,labels=c(month.name,"Annual mean",
WE>               "Annual integral","Integral
WE> (Jan-Mar)","Integral (Apr-Jun)","Integral (Jul-Sep)","Integral
WE> (Oct-Dec)",
WE>               "Integral (Jan-Feb)","Integral
WE> (Jan-Mar)","Integral (Jan-Apr)","Integral (Jan-May)","Integral
WE> (Jan-Jun)",
WE>               "Integral (Jan-Jul)","Integral
WE> (Jan-Aug)","Integral (Jan-Sep)","Integral (Jan-Oct)")),
WE>        data=dfame,as.table=TRUE,type=c("o","g","r"),layout=c(3,9),
WE>        ylab="Flow, Sv",xlab=NULL)

WE> However, instead of plots I am getting the following error
WE> Error in do.call("pmax", lapply(cond, is.na)) :
WE>         symbol print-name too long




More information about the R-help mailing list