[Roxygen-commits] r18 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 2 20:03:15 CEST 2008


Author: pcd
Date: 2008-06-02 20:03:15 +0200 (Mon, 02 Jun 2008)
New Revision: 18

Modified:
   pkg/R/example.R
Log:
clarify example


Modified: pkg/R/example.R
===================================================================
--- pkg/R/example.R	2008-06-02 14:04:08 UTC (rev 17)
+++ pkg/R/example.R	2008-06-02 18:03:15 UTC (rev 18)
@@ -4,23 +4,23 @@
 #' @slot birthyear The year of birth
 #' @prototype Prototype person is named John Doe
 #'      and born in the year 1971
-setClass('Person',
-         representation = representation (
-                     fullname = 'character',
-                     birthyear = 'numeric') ,
-         prototype = prototype (
-                     fullname = 'John Doe',
-                     birthyear = '1971' ))
+setClass('person',
+         representation=
+         representation(fullname='character',
+                        birthyear='numeric'),
+         prototype=
+         prototype(fullname='John Doe',
+                   birthyear=1971))
+
 #' The naming of an object.
 #'
 #' @param object A object which gets a name
-setGeneric('name', function(object, ...){})
+setGeneric('name', function(object) standardGeneric('name'))
+
 #' Name a person, the baptism.
 #'
 #' @param object A Person object
-#' @param ... Not used
 #' @export
-setMethod('name', signature('Person'),
-function(object, ...) {
-  ...
-})
+setMethod('name', 'person', function(object) object at fullname)
+
+## name(new('person', fullname='Jane Roe', birthyear=1776))



More information about the Roxygen-commits mailing list