[Rd] package.skeleton() in R-2.4.1

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Tue 12 Sep 2006 - 07:26:58 GMT


Hi

R version 2.4.0 alpha (2006-09-06 r39158) MacOSX 10.4.7

There was a thread some time ago as to whether the structure created by package.skeleton() would pass R CMD check.

I have an example where package.skeleton() gives an R file that gives an error when sourced.

If I type

setClass("brob",

          representation = representation (x="numeric",positive="logical"),

          prototype      = list(x=numeric(),positive=logical())
          )

setGeneric("getX",function(x){standardGeneric("getX")}) setMethod("getX","brob",function(x){x@x})

(which is legal, AFAICS), then

package.skeleton(path="~")

I get a file ~/anRpackage/R/getX.R containing:

"getX" <-
structure(function(x){standardGeneric("getX")} , generic = structure("getX", package = ".GlobalEnv"), package = ".GlobalEnv", group = list(), valueClass = character(0), signature = "x", default = <S4
object of class structure("MethodsList", package = "methods")>,
skeleton = quote(function (x)
stop("invalid call in method dispatch to 'getX' (no default method)",

     domain = NA)(x)), class = structure ("nonstandardGenericFunction", package = "methods"))

[subject to line breaking] but this file gives an error when sourced (below). I didn't get this problem with R-2.3.1.

> > source("/Users/rksh/anRpackage/R/getX.R")
Error in parse(file, n = -1, NULL, "?") : syntax error at 2: structure(function(x){standardGeneric("getX")} 3: , generic = structure("getX", package = ".GlobalEnv"), package = ".GlobalEnv", group = list(), valueClass = character(0), signature = "x", default = <
 >

Am I doing something wrong?

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue Sep 12 17:28:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 13 Sep 2006 - 16:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.