[Rd] Tidying R Code - S4 Classes

Thomas Stabla statho3 at web.de
Thu Dec 11 14:40:24 MET 2003


Hello,

I read the section "Tidying R Code" in "Writing R Extension" and tried to
tidy some of my class-definitions. ("Tidying R Code" doesn't mention
classes, just functions)

When I procede as follows in R 1.8.1

>
> options(keep.source = FALSE)
> source("myclass.R")
> dump(ls(all = TRUE), file = "new.myclass.R")
>

to tidy the class definition

>
> setClass("myclass", representation(a = "numeric", b = "numeric"))
>

the resulting code below in my opinion is by no ways more readable
and even worse, the file new.myclass.R produces a parsing error
if is read in via source or when pasted into the R process.

Is there someone working on this issue? Or is this irrelevant?

Best regards,
Thomas Stabla

--
Code produced by dump:

".__C__myclass" <-
structure(list(), slots = structure(list(a = "numeric", b = "numeric"),
.Names = c("a",
"b")), contains = list(), virtual = FALSE, prototype = structure(list(), a
`, access = list(), className = structure("myclass", package =
".GlobalEnv"), package = ".GlobalEnv", subclasses = list(),
versionKey = <pointer: 0x401e5bc0>, sealed = FALSE, class =
"classRepresentation")

NULL= numeric(0), b = numeric(0)), validity = `
--



More information about the R-devel mailing list