SCM

SCM Repository

[inlinedocs] Annotation of /pkg/inlinedocs/inst/testfiles/silly.R
ViewVC logotype

Annotation of /pkg/inlinedocs/inst/testfiles/silly.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 156 - (view) (download)

1 : kmpont 57 silly.example <- function
2 :     ### this function does nothing in particular and does it very well
3 :     (
4 :     ##title<<Simple function arguments
5 :     first, ##<< the first argument with a multi-line description
6 :     ## which I really have to put here rather than explaining in the details.
7 :     second= ##<< the second argument with a list default value
8 :     ## and descriptions of each of the elements
9 :     ##describe<<
10 :     list(this="that", ##<< whichness
11 :     the="other", ##<< of the
12 :     rhubarb="stew", ##<< why
13 :     foo="bar"),
14 :     ##end<<
15 :     third ##<< an argument that does nothing
16 :     )
17 :     {
18 :     ##description<<why should I add to description?
19 :     ##details<<
20 :     ## if second is TRUE then first is returned
21 :     if ( second ){
22 :     ##alias<<Long silly alias
23 :     res <- first
24 :     } else {
25 :     ##details<<
26 :     ## if second is not TRUE then a list is returned
27 :     ##describe<<The contents of the list are:
28 :     res <- list(x=7, ##<< x coordinate
29 :     z= ##<< z describes everything else
30 :     ##describe<<
31 :     list(colour=green, ##<< colour of line
32 :     width=2), ##<< width of line
33 :     ##end<<
34 :     ## and this line should get into documentation for z
35 :     y=10)##<< y coordinate
36 :     }
37 :     ##note<< a note
38 :     ##references<< a reference
39 : tdhock 156 ##seealso<< \code{\link{Silly-class}}
40 : kmpont 57 ##keyword<<documentation utilities
41 :     invisible(res)
42 :     ### invisible something not unrelated to first
43 :     }
44 : kmpont 60
45 :     setClass("Silly", # S4 classes can be documented as well
46 :     ### The Silly class does nothing much either
47 : kmpont 66 ##details<< Put what you like in documentation details,
48 :     ## but ideally reference construction methods.
49 : kmpont 60 representation(forwards="function", ##<< forward operation
50 :     reverse="function", ##<< how to go backward
51 : tdhock 156 crashes="integer") ##<< how many crashes
52 : kmpont 60 ) ##<< this comment is ignored as it is outside setClass expression
53 : kmpont 66
54 : tdhock 115 .result <-
55 : tdhock 156 list(silly.example = list(definition = "silly.example <- function\n### this function does nothing in particular and does it very well\n(\n ##title<<Simple function arguments\n first, ##<< the first argument with a multi-line description\n ## which I really have to put here rather than explaining in the details.\n second= ##<< the second argument with a list default value\n ## and descriptions of each of the elements\n ##describe<<\n list(this=\"that\", ##<< whichness\n the=\"other\", ##<< of the\n rhubarb=\"stew\", ##<< why\n foo=\"bar\"),\n ##end<<\n third ##<< an argument that does nothing\n )\n{\n ##description<<why should I add to description?\n ##details<<\n ## if second is TRUE then first is returned\n if ( second ){\n ##alias<<Long silly alias\n res <- first\n } else {\n ##details<<\n ## if second is not TRUE then a list is returned\n ##describe<<The contents of the list are:\n res <- list(x=7, ##<< x coordinate\n z= ##<< z describes everything else\n ##describe<<\n list(colour=green, ##<< colour of line\n width=2), ##<< width of line\n ##end<<\n ## and this line should get into documentation for z\n y=10)##<< y coordinate\n }\n ##note<< a note\n ##references<< a reference\n ##seealso<< \\code{\\link{Silly-class}}\n ##keyword<<documentation utilities\n invisible(res)\n### invisible something not unrelated to first\n}",
56 : tdhock 138 format="",
57 : tdhock 115 description = "this function does nothing in particular and does it very well\nwhy should I add to description?",
58 :     value = "invisible something not unrelated to first", title = "Simple function arguments",
59 :     `item{first}` = "the first argument with a multi-line description\nwhich I really have to put here rather than explaining in the details.",
60 :     `item{second}` = "the second argument with a list default value\nand descriptions of each of the elements\\describe{\n\\item{this}{whichness}\n\\item{the}{of the}\n\\item{rhubarb}{why}\n}",
61 :     `item{third}` = "an argument that does nothing", details = "if second is TRUE then first is returned\n\nif second is not TRUE then a list is returned\n\nThe contents of the list are:\\describe{\n\\item{x}{x coordinate}\n\\item{z}{z describes everything else\\describe{\n\\item{colour}{colour of line}\n\\item{width}{width of line}\n}\nand this line should get into documentation for z}\n\\item{y}{y coordinate}\n}",
62 :     alias = "Long silly alias", note = "a note", references = "a reference",
63 : tdhock 156 seealso = "\\code{\\link{Silly-class}}", keyword = "documentation}\n\\keyword{utilities"),
64 : tdhock 138 `Silly-class` = list(title = "S4 classes can be documented as well",
65 :     format="",
66 : tdhock 115 description = "The Silly class does nothing much either",
67 :     details = "Put what you like in documentation details,\nbut ideally reference construction methods.",
68 :     `item{forwards}` = "forward operation", `item{reverse}` = "how to go backward",
69 :     `item{crashes}` = "how many crashes", `section{Objects from the Class}` = "Put what you like in documentation details,\nbut ideally reference construction methods.",
70 :     seealso = "", alias = "Silly"))

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge