In browsing the source I see the following construct: res <- switch(type, working = , response = r, deviance = , pearson = if (is.null(object$weights)) r else r * sqrt(object$weights), partial = r)
I understand that 'switch' will execute the code that is matched by its corresponding string value (in this case 'type'). What I don't understand is the empty code. Is this code saying that if the type is "deviance" then fill the 'res' variable with an empty value? From my naive point of view it seems that 'res' will only get a value(s) if 'type' is 'response', 'pearson', or 'partial'. Please help with my understanding. Kevin Burton rkevinbur...@charter.net ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.