Hi all,

I am just learning R and I am trying to work through the book "Applied 
Longitudinal Data Analysis" by Singer & Willett.  I have some code for this book 
that supposedly works in S-Plus (I don't have S-Plus so I can't verify that) and 
I am trying to run the examples in R.  Most of the examples run, but I have 
one plot that gives me an error message.  I have provided a small dataset below 
and the problematic code.

I don't know if the problem is a dissimilarity between R and S-Plus, or if I 
have done something wrong because I don't know R well enough yet (I am also 
working through MASS by Venables & Ripley, and the Pinheiro & Bates book on 
Mixed-Effect Models).  

I looked at the warnings and also did traceback() which just took me to the 
function listed in the error message.  I can't determine where the NA/NaN/Inf 
is (are) coming from.

Any help would be appreciated.  I am using Rwin 1.8.1 (pre-compiled) on 
Win2000 Professional.

Thanks,

Dan Nordlund

## toy problem
library(nlme)

tolerance.pp <- as.data.frame(
matrix(c(   
9,11,2.23,
9,12,1.79,
9,13,1.90,
9,14,2.12,
9,15,2.66,
45,11,1.12,
45,12,1.45,
45,13,1.45,
45,14,1.45,
45,15,1.99,
268,11,1.45,
268,12,1.34,
268,13,1.99,
268,14,1.79,
268,15,1.34,
314,11,1.22,
314,12,1.22,
314,13,1.55,
314,14,1.12,
314,15,1.12
), byrow = T, ncol = 3 ))

names(tolerance.pp) <- c('id','age','tolerance')

## this plots out fine
xyplot(tolerance~age | factor(id), data=tolerance.pp)

## this produces an error message
xyplot(tolerance~age | factor(id), data=tolerance.pp, 
  prepanel = function(x, y) prepanel.loess(x, y), 
  panel = function(x, y){
    panel.xyplot(x, y)
    panel.loess(x, y)
  }, ylim=c(0, 4), as.table=T)


Error message is:

>Error in simpleLoess(y, x, w, span, degree, FALSE, FALSE, normalize = FALSE, 
 : 
>        NA/NaN/Inf in foreign function call (arg 1)
>In addition: There were 16 warnings (use warnings() to see them)


        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to