The R Project SVN R

Rev

Rev 63178 | Rev 63381 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
56186 murdoch 1
 
63202 ripley 2
R Under development (unstable) (2013-07-06 r63201) -- "Unsuffered Consequences"
61787 ripley 3
Copyright (C) 2013 The R Foundation for Statistical Computing
61161 ripley 4
Platform: x86_64-unknown-linux-gnu (64-bit)
56186 murdoch 5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
8
Type 'license()' or 'licence()' for distribution details.
9
 
10
  Natural language support but running in an English locale
11
 
12
R is a collaborative project with many contributors.
13
Type 'contributors()' for more information and
14
'citation()' on how to cite R or R packages in publications.
15
 
16
Type 'demo()' for some demos, 'help()' for on-line help, or
17
'help.start()' for an HTML browser interface to help.
18
Type 'q()' to quit R.
19
 
20
> pkgname <- "tools"
21
> source(file.path(R.home("share"), "R", "examples-header.R"))
22
> options(warn = 1)
23
> library('tools')
24
> 
61787 ripley 25
> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv')
56186 murdoch 26
> cleanEx()
27
> nameEx("HTMLheader")
28
> ### * HTMLheader
29
> 
30
> flush(stderr()); flush(stdout())
31
> 
32
> ### Name: HTMLheader
33
> ### Title: Generate a standard HTML header for R help
34
> ### Aliases: HTMLheader
35
> ### Keywords: utilities documentation
36
> 
37
> ### ** Examples
38
> 
39
> cat(HTMLheader("This is a sample header"), sep="\n")
40
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
41
<html><head><title>R: This is a sample header</title>
42
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
43
<link rel="stylesheet" type="text/css" href="/doc/html/R.css">
44
</head><body>
45
<h1> This is a sample header
56582 murdoch 46
<img class="toplogo" src="/doc/html/logo.jpg" alt="[R logo]">
56186 murdoch 47
</h1>
48
<hr>
49
<div align="center">
50
<a href="/doc/html/index.html"><img src="/doc/html/up.jpg" alt="[Top]" width="30" height="30" border="0"></a>
51
</div>
52
> 
53
> 
54
> 
55
> cleanEx()
56
> nameEx("Rd2HTML")
57
> ### * Rd2HTML
58
> 
59
> flush(stderr()); flush(stdout())
60
> 
61
> ### Name: Rd2HTML
62
> ### Title: Rd Converters
63
> ### Aliases: Rd2txt Rd2HTML Rd2ex Rd2latex
64
> ### Keywords: documentation
65
> 
66
> ### ** Examples
67
> cleanEx()
68
> nameEx("Rd2txt_options")
69
> ### * Rd2txt_options
70
> 
71
> flush(stderr()); flush(stdout())
72
> 
73
> ### Name: Rd2txt_options
74
> ### Title: Set formatting options for text help
75
> ### Aliases: Rd2txt_options
76
> ### Keywords: documentation
77
> 
78
> ### ** Examples
79
> 
80
> saveOpts <- Rd2txt_options()
81
> saveOpts
82
$width
83
[1] 80
84
 
85
$minIndent
86
[1] 10
87
 
88
$extraIndent
89
[1] 4
90
 
91
$sectionIndent
92
[1] 5
93
 
94
$sectionExtra
95
[1] 2
96
 
97
$itemBullet
98
[1] "* "
99
 
100
$enumFormat
101
function (n) 
102
sprintf("%d. ", n)
63202 ripley 103
<environment: 0x1dcc408>
56186 murdoch 104
 
105
$showURLs
106
[1] FALSE
107
 
108
$code_quote
109
[1] TRUE
110
 
111
$underline_titles
112
[1] TRUE
113
 
61161 ripley 114
> Rd2txt_options(minIndent = 4)
56186 murdoch 115
> Rd2txt_options()
116
$width
117
[1] 80
118
 
119
$minIndent
120
[1] 4
121
 
122
$extraIndent
123
[1] 4
124
 
125
$sectionIndent
126
[1] 5
127
 
128
$sectionExtra
129
[1] 2
130
 
131
$itemBullet
132
[1] "* "
133
 
134
$enumFormat
135
function (n) 
136
sprintf("%d. ", n)
63202 ripley 137
<environment: 0x1dcc408>
56186 murdoch 138
 
139
$showURLs
140
[1] FALSE
141
 
142
$code_quote
143
[1] TRUE
144
 
145
$underline_titles
146
[1] TRUE
147
 
148
> Rd2txt_options(saveOpts)
149
> Rd2txt_options()
150
$width
151
[1] 80
152
 
153
$minIndent
154
[1] 10
155
 
156
$extraIndent
157
[1] 4
158
 
159
$sectionIndent
160
[1] 5
161
 
162
$sectionExtra
163
[1] 2
164
 
165
$itemBullet
166
[1] "* "
167
 
168
$enumFormat
169
function (n) 
170
sprintf("%d. ", n)
63202 ripley 171
<environment: 0x1dcc408>
56186 murdoch 172
 
173
$showURLs
174
[1] FALSE
175
 
176
$code_quote
177
[1] TRUE
178
 
179
$underline_titles
180
[1] TRUE
181
 
182
> 
183
> 
184
> 
185
> cleanEx()
186
> nameEx("Rdutils")
187
> ### * Rdutils
188
> 
189
> flush(stderr()); flush(stdout())
190
> 
191
> ### Name: Rdutils
192
> ### Title: Rd Utilities
193
> ### Aliases: Rd_db
194
> ### Keywords: utilities documentation
195
> 
196
> ### ** Examples
197
> 
198
> 
199
> cleanEx()
63062 maechler 200
> nameEx("assertCondition")
201
> ### * assertCondition
202
> 
203
> flush(stderr()); flush(stdout())
204
> 
205
> ### Name: assertCondition
206
> ### Title: Asserting Error Conditions
63202 ripley 207
> ### Aliases: assertCondition assertWarning assertError
63062 maechler 208
> ### Keywords: programming error
209
> 
210
> ### ** Examples
211
> 
63202 ripley 212
>   assertError(sqrt("abc"))
213
>   assertWarning(matrix(1:8, 4,3))
63062 maechler 214
> 
63202 ripley 215
>   assertCondition( ""-1 ) # ok, any condition would satisfy this
216
> 
63062 maechler 217
> try( assertCondition(sqrt(2), "warning") )
218
Error in assertCondition(sqrt(2), "warning") : 
63202 ripley 219
  Failed to get warning in evaluating sqrt(2)
220
> ## .. Failed to get warning in evaluating sqrt(2)
63062 maechler 221
>      assertCondition(sqrt("abc"), "error")   # ok
222
> try( assertCondition(sqrt("abc"), "warning") )# -> error: had no warning
223
Error in assertCondition(sqrt("abc"), "warning") : 
63202 ripley 224
  Got simpleError in evaluating sqrt("abc"); wanted warning
225
>      assertCondition(sqrt("abc"), "error") 
226
>   ## identical to assertError() call above
63062 maechler 227
> 
63146 maechler 228
> assertCondition(matrix(1:5, 2,3), "warning")
63062 maechler 229
> try( assertCondition(matrix(1:8, 4,3), "error") )
230
Error in assertCondition(matrix(1:8, 4, 3), "error") : 
63202 ripley 231
  Got simpleWarning in evaluating matrix(1:8, 4, 3); wanted error
63146 maechler 232
> ## .. Failed to get expected error ....
63062 maechler 233
> 
234
> ## either warning or worse:
63202 ripley 235
> assertCondition(matrix(1:8, 4,3), "error","warning") # OK
236
> assertCondition(matrix(1:8, 4, 3), "warning") # OK 
63062 maechler 237
> 
63146 maechler 238
> ## when both are signalled:
239
> ff <- function() { warning("my warning"); stop("my error") }
240
>     assertCondition(ff(), "warning")
63202 ripley 241
> ## but assertWarning does not allow an error to follow
242
> try(assertWarning(ff()))
243
Error in assertWarning(ff()) : 
244
  Got warning in evaluating ff(), but also an error
63173 maechler 245
>     assertCondition(ff(), "error")          # ok
63146 maechler 246
> assertCondition(ff(), "error", "warning") # ok (quietly, catching warning)
63062 maechler 247
> 
63173 maechler 248
> ## assert that assertC..() does not assert [and use *one* argument only]
249
> assertCondition( assertCondition(sqrt( 2   ), "warning") )
250
> assertCondition( assertCondition(sqrt("abc"), "warning"), "error")
251
> assertCondition( assertCondition(matrix(1:8, 4,3), "error"),
63202 ripley 252
+                 "error")
63062 maechler 253
> 
63146 maechler 254
> 
63173 maechler 255
> 
63062 maechler 256
> cleanEx()
56186 murdoch 257
> nameEx("bibstyle")
258
> ### * bibstyle
259
> 
260
> flush(stderr()); flush(stdout())
261
> 
262
> ### Name: bibstyle
263
> ### Title: Select or define a bibliography style.
59584 ripley 264
> ### Aliases: bibstyle getBibstyle
56186 murdoch 265
> ### Keywords: utilties documentation
266
> 
267
> ### ** Examples
268
> 
269
> ## Don't show: 
270
> options(useFancyQuotes = FALSE)
271
> ## End Don't show
61435 ripley 272
> refs <-
56186 murdoch 273
+ c(bibentry(bibtype = "manual",
274
+     title = "R: A Language and Environment for Statistical Computing",
59036 ripley 275
+     author = person("R Core Team"),
56186 murdoch 276
+     organization = "R Foundation for Statistical Computing",
277
+     address = "Vienna, Austria",
62216 ripley 278
+     year = 2013,
61435 ripley 279
+     url = "http://www.R-project.org"),
56186 murdoch 280
+   bibentry(bibtype = "article",
62216 ripley 281
+     author = c(person(c("George", "E.", "P."), "Box"),
282
+                person(c("David",  "R."),      "Cox")),
56186 murdoch 283
+     year = 1964,
56281 ripley 284
+     title = "An Analysis of Transformations",
285
+     journal = "Journal of the Royal Statistical Society, Series B",
286
+     volume = 26,
287
+     pages = "211-252"))
61435 ripley 288
> 
56281 ripley 289
> bibstyle("unsorted", sortKeys = function(refs) seq_along(refs),
59618 ripley 290
+     fmtPrefix = function(paper) paste0("[", paper$.index, "]"),
56281 ripley 291
+        .init = TRUE)
63202 ripley 292
<environment: 0x236fc30>
61435 ripley 293
> print(refs, .bibstyle = "unsorted")
62216 ripley 294
[1] R Core Team (2013). _R: A Language and Environment for Statistical
59036 ripley 295
Computing_. R Foundation for Statistical Computing, Vienna, Austria.
62420 ripley 296
<URL: http://www.R-project.org>.
56186 murdoch 297
 
59618 ripley 298
[2] Box GEP and Cox DR (1964). "An Analysis of Transformations."
299
_Journal of the Royal Statistical Society, Series B_, *26*, pp.
300
211-252.
56186 murdoch 301
> 
302
> 
303
> 
304
> cleanEx()
305
> nameEx("charsets")
306
> ### * charsets
307
> 
308
> flush(stderr()); flush(stdout())
309
> 
310
> ### Name: charsets
311
> ### Title: Conversion Tables between Character Sets
312
> ### Aliases: Adobe_glyphs charset_to_Unicode
313
> ### Keywords: datasets
314
> 
315
> ### ** Examples
316
> 
317
> ## find Adobe names for ISOLatin2 chars.
318
> latin2 <- charset_to_Unicode[, "ISOLatin2"]
61161 ripley 319
> aUnicode <- as.numeric(paste0("0x", Adobe_glyphs$unicode))
56186 murdoch 320
> keep <- aUnicode %in% latin2
321
> aUnicode <- aUnicode[keep]
322
> aAdobe <- Adobe_glyphs[keep, 1]
323
> ## first match
324
> aLatin2 <- aAdobe[match(latin2, aUnicode)]
325
> ## all matches
326
> bLatin2 <- lapply(1:256, function(x) aAdobe[aUnicode == latin2[x]])
61161 ripley 327
> format(bLatin2, justify = "none")
56186 murdoch 328
  [1] ""                          "controlSTX"               
329
  [3] "controlSOT"                "controlETX"               
330
  [5] "controlEOT"                "controlENQ"               
331
  [7] "controlACK"                "controlBEL"               
332
  [9] "controlBS"                 "controlHT"                
333
 [11] "controlLF"                 "controlVT"                
334
 [13] "controlFF"                 "controlCR"                
335
 [15] "controlSO"                 "controlSI"                
336
 [17] "controlDLE"                "controlDC1"               
337
 [19] "controlDC2"                "controlDC3"               
338
 [21] "controlDC4"                "controlNAK"               
339
 [23] "controlSYN"                "controlETB"               
340
 [25] "controlCAN"                "controlEM"                
341
 [27] "controlSUB"                "controlESC"               
342
 [29] "controlFS"                 "controlGS"                
343
 [31] "controlRS"                 "controlUS"                
344
 [33] "space, spacehackarabic"    "exclam"                   
345
 [35] "quotedbl"                  "numbersign"               
346
 [37] "dollar"                    "percent"                  
347
 [39] "ampersand"                 "quotesingle"              
348
 [41] "parenleft"                 "parenright"               
349
 [43] "asterisk"                  "plus"                     
350
 [45] "comma"                     "hyphen"                   
351
 [47] "period"                    "slash"                    
352
 [49] "zero"                      "one"                      
353
 [51] "two"                       "three"                    
354
 [53] "four"                      "five"                     
355
 [55] "six"                       "seven"                    
356
 [57] "eight"                     "nine"                     
357
 [59] "colon"                     "semicolon"                
358
 [61] "less"                      "equal"                    
359
 [63] "greater"                   "question"                 
360
 [65] "at"                        "A"                        
361
 [67] "B"                         "C"                        
362
 [69] "D"                         "E"                        
363
 [71] "F"                         "G"                        
364
 [73] "H"                         "I"                        
365
 [75] "J"                         "K"                        
366
 [77] "L"                         "M"                        
367
 [79] "N"                         "O"                        
368
 [81] "P"                         "Q"                        
369
 [83] "R"                         "S"                        
370
 [85] "T"                         "U"                        
371
 [87] "V"                         "W"                        
372
 [89] "X"                         "Y"                        
373
 [91] "Z"                         "bracketleft"              
374
 [93] "backslash"                 "bracketright"             
375
 [95] "asciicircum"               "underscore"               
376
 [97] "grave"                     "a"                        
377
 [99] "b"                         "c"                        
378
[101] "d"                         "e"                        
379
[103] "f"                         "g"                        
380
[105] "h"                         "i"                        
381
[107] "j"                         "k"                        
382
[109] "l"                         "m"                        
383
[111] "n"                         "o"                        
384
[113] "p"                         "q"                        
385
[115] "r"                         "s"                        
386
[117] "t"                         "u"                        
387
[119] "v"                         "w"                        
388
[121] "x"                         "y"                        
389
[123] "z"                         "braceleft"                
390
[125] "bar, verticalbar"          "braceright"               
391
[127] "asciitilde"                "controlDEL"               
392
[129] ""                          ""                         
393
[131] ""                          ""                         
394
[133] ""                          ""                         
395
[135] ""                          ""                         
396
[137] ""                          ""                         
397
[139] ""                          ""                         
398
[141] ""                          ""                         
399
[143] ""                          ""                         
400
[145] ""                          ""                         
401
[147] ""                          ""                         
402
[149] ""                          ""                         
403
[151] ""                          ""                         
404
[153] ""                          ""                         
405
[155] ""                          ""                         
406
[157] ""                          ""                         
407
[159] ""                          ""                         
408
[161] "nbspace, nonbreakingspace" "Aogonek"                  
409
[163] "breve"                     "Lslash"                   
410
[165] "currency"                  "Lcaron"                   
411
[167] "Sacute"                    "section"                  
412
[169] "dieresis"                  "Scaron"                   
413
[171] "Scedilla"                  "Tcaron"                   
414
[173] "Zacute"                    "sfthyphen, softhyphen"    
415
[175] "Zcaron"                    "Zdot, Zdotaccent"         
416
[177] "degree"                    "aogonek"                  
417
[179] "ogonek"                    "lslash"                   
418
[181] "acute"                     "lcaron"                   
419
[183] "sacute"                    "caron"                    
420
[185] "cedilla"                   "scaron"                   
421
[187] "scedilla"                  "tcaron"                   
422
[189] "zacute"                    "hungarumlaut"             
423
[191] "zcaron"                    "zdot, zdotaccent"         
424
[193] "Racute"                    "Aacute"                   
425
[195] "Acircumflex"               "Abreve"                   
426
[197] "Adieresis"                 "Lacute"                   
427
[199] "Cacute"                    "Ccedilla"                 
428
[201] "Ccaron"                    "Eacute"                   
429
[203] "Eogonek"                   "Edieresis"                
430
[205] "Ecaron"                    "Iacute"                   
431
[207] "Icircumflex"               "Dcaron"                   
432
[209] "Dcroat, Dslash"            "Nacute"                   
433
[211] "Ncaron"                    "Oacute"                   
434
[213] "Ocircumflex"               "Odblacute, Ohungarumlaut" 
435
[215] "Odieresis"                 "multiply"                 
436
[217] "Rcaron"                    "Uring"                    
437
[219] "Uacute"                    "Udblacute, Uhungarumlaut" 
438
[221] "Udieresis"                 "Yacute"                   
439
[223] "Tcedilla, Tcommaaccent"    "germandbls"               
440
[225] "racute"                    "aacute"                   
441
[227] "acircumflex"               "abreve"                   
442
[229] "adieresis"                 "lacute"                   
443
[231] "cacute"                    "ccedilla"                 
444
[233] "ccaron"                    "eacute"                   
445
[235] "eogonek"                   "edieresis"                
446
[237] "ecaron"                    "iacute"                   
447
[239] "icircumflex"               "dcaron"                   
448
[241] "dcroat, dmacron"           "nacute"                   
449
[243] "ncaron"                    "oacute"                   
450
[245] "ocircumflex"               "odblacute, ohungarumlaut" 
451
[247] "odieresis"                 "divide"                   
452
[249] "rcaron"                    "uring"                    
453
[251] "uacute"                    "udblacute, uhungarumlaut" 
454
[253] "udieresis"                 "yacute"                   
455
[255] "tcedilla, tcommaaccent"    "dotaccent"                
456
> 
457
> 
458
> 
459
> cleanEx()
460
> nameEx("checkFF")
461
> ### * checkFF
462
> 
463
> flush(stderr()); flush(stdout())
464
> 
465
> ### Name: checkFF
466
> ### Title: Check Foreign Function Calls
467
> ### Aliases: checkFF print.checkFF
468
> ### Keywords: programming utilities
469
> 
470
> ### ** Examples
471
> 
472
> 
473
> cleanEx()
59221 ripley 474
> nameEx("checkPoFiles")
475
> ### * checkPoFiles
476
> 
477
> flush(stderr()); flush(stdout())
478
> 
479
> ### Name: checkPoFiles
480
> ### Title: Check translation files for inconsistent format strings.
481
> ### Aliases: checkPoFile checkPoFiles
482
> ### Keywords: utilities
483
> 
484
> ### ** Examples
485
> 
486
> ## Not run: 
487
> ##D checkPoFiles("de", "/path/to/R/src/directory")
488
> ## End(Not run)
489
> 
490
> 
491
> 
492
> cleanEx()
56186 murdoch 493
> nameEx("checkRdaFiles")
494
> ### * checkRdaFiles
495
> 
496
> flush(stderr()); flush(stdout())
497
> 
498
> ### Name: checkRdaFiles
499
> ### Title: Report on Details of Saved Images or Re-saves them
500
> ### Aliases: checkRdaFiles resaveRdaFiles
501
> ### Keywords: utilities
502
> 
503
> ### ** Examples
504
> ## Not run: 
505
> ##D ## from a package top-level source directory
506
> ##D paths <- sort(Sys.glob(c("data/*.rda", "data/*.RData")))
507
> ##D (res <- checkRdaFiles(paths))
508
> ##D ## pick out some that may need attention
509
> ##D bad <- is.na(res$ASCII) | res$ASCII | (res$size > 1e4 & res$compress == "none")
510
> ##D res[bad, ]
511
> ## End(Not run)
512
> 
513
> 
514
> cleanEx()
515
> nameEx("delimMatch")
516
> ### * delimMatch
517
> 
518
> flush(stderr()); flush(stdout())
519
> 
520
> ### Name: delimMatch
521
> ### Title: Delimited Pattern Matching
522
> ### Aliases: delimMatch
523
> ### Keywords: character
524
> 
525
> ### ** Examples
526
> 
527
> x <- c("\\value{foo}", "function(bar)")
528
> delimMatch(x)
529
[1]  7 -1
530
attr(,"match.length")
531
[1]  5 -1
532
> delimMatch(x, c("(", ")"))
533
[1] -1  9
534
attr(,"match.length")
535
[1] -1  5
536
> 
537
> 
538
> 
539
> cleanEx()
540
> nameEx("dependsOnPkgs")
541
> ### * dependsOnPkgs
542
> 
543
> flush(stderr()); flush(stdout())
544
> 
545
> ### Name: dependsOnPkgs
546
> ### Title: Find Reverse Dependencies
547
> ### Aliases: dependsOnPkgs
548
> ### Keywords: utilities
549
> 
550
> ### ** Examples
551
> 
552
> ## there are few dependencies in a vanilla R installation
553
> dependsOnPkgs("lattice")
554
[1] "Matrix" "nlme"   "mgcv"  
555
> 
556
> 
557
> 
558
> cleanEx()
559
> nameEx("encoded")
560
> ### * encoded
561
> 
562
> flush(stderr()); flush(stdout())
563
> 
564
> ### Name: encoded_text_to_latex
565
> ### Title: Translate non-ASCII Text to LaTeX Escapes
566
> ### Aliases: encoded_text_to_latex
567
> ### Keywords: utilities
568
> 
569
> ### ** Examples
570
> 
571
> x <- "fa\xE7ile"
572
> encoded_text_to_latex(x, "latin1")
573
[1] "fa{\\c c}ile"
574
> ## Not run: 
575
> ##D ## create a tex file to show the upper half of 8-bit charsets
61161 ripley 576
> ##D x <- rawToChar(as.raw(160:255), multiple = TRUE)
577
> ##D (x <- matrix(x, ncol = 16, byrow = TRUE))
56186 murdoch 578
> ##D xx <- x
579
> ##D xx[] <- encoded_text_to_latex(x, "latin1") # or latin2 or latin9
61161 ripley 580
> ##D xx <- apply(xx, 1, paste, collapse = "&")
56186 murdoch 581
> ##D con <- file("test-encoding.tex", "w")
582
> ##D header <- c(
583
> ##D "\\documentclass{article}",
584
> ##D "\\usepackage[T1]{fontenc}",
585
> ##D "\\usepackage{Rd}",
586
> ##D "\\begin{document}",
587
> ##D "\\HeaderA{test}{}{test}",
588
> ##D "\\begin{Details}\relax",
589
> ##D "\\Tabular{cccccccccccccccc}{")
590
> ##D trailer <- c("}", "\\end{Details}", "\\end{document}")
591
> ##D writeLines(header, con)
61161 ripley 592
> ##D writeLines(paste0(xx, "\\"), con)
56186 murdoch 593
> ##D writeLines(trailer, con)
594
> ##D close(con)
595
> ##D ## and some UTF_8 chars
596
> ##D x <- intToUtf8(as.integer(
597
> ##D     c(160:383,0x0192,0x02C6,0x02C7,0x02CA,0x02D8,
598
> ##D       0x02D9, 0x02DD, 0x200C, 0x2018, 0x2019, 0x201C,
599
> ##D       0x201D, 0x2020, 0x2022, 0x2026, 0x20AC)),
61161 ripley 600
> ##D                multiple = TRUE)
601
> ##D x <- matrix(x, ncol = 16, byrow = TRUE)
56186 murdoch 602
> ##D xx <- x
603
> ##D xx[] <- encoded_text_to_latex(x, "UTF-8")
61161 ripley 604
> ##D xx <- apply(xx, 1, paste, collapse = "&")
56186 murdoch 605
> ##D con <- file("test-utf8.tex", "w")
606
> ##D writeLines(header, con)
61161 ripley 607
> ##D writeLines(paste(xx, "\\", sep = ""), con)
56186 murdoch 608
> ##D writeLines(trailer, con)
609
> ##D close(con)
610
> ## End(Not run)
611
> 
612
> 
613
> cleanEx()
614
> nameEx("fileutils")
615
> ### * fileutils
616
> 
617
> flush(stderr()); flush(stdout())
618
> 
619
> ### Name: fileutils
620
> ### Title: File Utilities
621
> ### Aliases: file_ext file_path_as_absolute file_path_sans_ext
622
> ###   list_files_with_exts list_files_with_type
623
> ### Keywords: file
624
> 
625
> ### ** Examples
626
> 
627
> 
628
> cleanEx()
629
> nameEx("getDepList")
630
> ### * getDepList
631
> 
632
> flush(stderr()); flush(stdout())
633
> 
634
> ### Name: getDepList
635
> ### Title: Functions to Retrieve Dependency Information
636
> ### Aliases: getDepList pkgDepends
637
> ### Keywords: utilities
638
> 
639
> ### ** Examples
640
> 
641
> pkgDepends("tools", local = FALSE)
642
$Depends
643
character(0)
644
 
645
$Installed
646
character(0)
647
 
648
$Found
649
list()
650
 
651
$NotFound
652
character(0)
653
 
654
$R
655
character(0)
656
 
657
attr(,"class")
658
[1] "DependsList" "list"       
659
> 
660
> 
661
> 
662
> cleanEx()
62998 murdoch 663
> nameEx("getVignetteInfo")
664
> ### * getVignetteInfo
665
> 
666
> flush(stderr()); flush(stdout())
667
> 
668
> ### Name: getVignetteInfo
669
> ### Title: Get information on installed vignettes.
670
> ### Aliases: getVignetteInfo
671
> ### Keywords: utilities documentation
672
> 
673
> ### ** Examples
674
> 
675
> 
676
> 
677
> 
678
> cleanEx()
56186 murdoch 679
> nameEx("installFoundDepends")
680
> ### * installFoundDepends
681
> 
682
> flush(stderr()); flush(stdout())
683
> 
684
> ### Name: installFoundDepends
685
> ### Title: A function to install unresolved dependencies
686
> ### Aliases: installFoundDepends
687
> ### Keywords: utilities
688
> 
689
> ### ** Examples
690
> 
691
> ## Set up a temporary directory to install packages to
692
> tmp <- tempfile()
693
> dir.create(tmp)
694
> 
61161 ripley 695
> pDL <- pkgDepends("tools", local = FALSE)
696
> installFoundDepends(pDL$Found, destdir = tmp)
56186 murdoch 697
NULL
698
> 
699
> 
700
> 
701
> cleanEx()
702
> nameEx("md5sum")
703
> ### * md5sum
704
> 
705
> flush(stderr()); flush(stdout())
706
> 
707
> ### Name: md5sum
708
> ### Title: Compute MD5 Checksums
709
> ### Aliases: md5sum
710
> ### Keywords: utilities
711
> 
712
> ### ** Examples
713
> 
61161 ripley 714
> as.vector(md5sum(dir(R.home(), pattern = "^COPY", full.names = TRUE)))
56186 murdoch 715
[1] "eb723b61539feef013de476e68b5c50a"
716
> 
717
> 
718
> 
719
> cleanEx()
58433 ligges 720
> nameEx("package_dependencies")
721
> ### * package_dependencies
722
> 
723
> flush(stderr()); flush(stdout())
724
> 
725
> ### Name: package_dependencies
726
> ### Title: Computations on the Dependency Hierarchy of Packages
727
> ### Aliases: package_dependencies
728
> ### Keywords: utilities
729
> 
730
> ### ** Examples
731
> 
732
> ## Not run: 
733
> ##D pdb <- available.packages()
734
> ##D deps <- package_dependencies(packages = "MASS", pdb,
735
> ##D                     which = c("Depends", "Imports", "LinkingTo", "Suggests"),
736
> ##D                     recursive = TRUE, reverse = TRUE)
737
> ##D length(deps$MASS)
738
> ## End(Not run)
739
> 
740
> 
741
> 
742
> cleanEx()
56186 murdoch 743
> nameEx("parseLatex")
744
> ### * parseLatex
745
> 
746
> flush(stderr()); flush(stdout())
747
> 
748
> ### Name: parseLatex
749
> ### Title: These experimental functions work with a subset of LaTeX code.
750
> ### Aliases: parseLatex deparseLatex latexToUtf8
751
> ### Keywords: utilities documentation
752
> 
753
> ### ** Examples
754
> 
755
> 
756
> cleanEx()
61330 ripley 757
> nameEx("print.via.format")
758
> ### * print.via.format
759
> 
760
> flush(stderr()); flush(stdout())
761
> 
762
> ### Name: .print.via.format
763
> ### Title: Printing Utilities
764
> ### Aliases: .print.via.format
765
> ### Keywords: utilities
766
> 
767
> ### ** Examples
768
> 
769
> ## The function is simply defined as
770
>  function (x, ...) {
771
+     writeLines(format(x, ...))
772
+     invisible(x)
773
+  }
774
function (x, ...) 
775
{
776
    writeLines(format(x, ...))
777
    invisible(x)
778
}
779
> 
780
> ## is used for simple print methods in R, and as prototype for new methods.
781
> 
782
> 
783
> 
784
> cleanEx()
56634 ripley 785
> nameEx("pskill")
786
> ### * pskill
787
> 
788
> flush(stderr()); flush(stdout())
789
> 
790
> ### Name: pskill
791
> ### Title: Kill a Process
792
> ### Aliases: pskill SIGHUP SIGINT SIGQUIT SIGKILL SIGTERM SIGSTOP SIGTSTP
56644 ripley 793
> ###   SIGCONT SIGCHLD SIGUSR1 SIGUSR2
56634 ripley 794
> ### Keywords: utilities
795
> 
796
> ### ** Examples
797
> ## Not run: 
798
> ##D pskill(c(237, 245), SIGKILL)
799
> ## End(Not run)
800
> 
801
> 
802
> cleanEx()
56186 murdoch 803
> nameEx("readNEWS")
804
> ### * readNEWS
805
> 
806
> flush(stderr()); flush(stdout())
807
> 
808
> ### Name: readNEWS
809
> ### Title: Read R's NEWS file or a similar one
810
> ### Aliases: readNEWS checkNEWS
811
> ### Keywords: file documentation
812
> 
813
> ### ** Examples
814
> # Check the current NEWS file
815
> 
816
> stopifnot(checkNEWS())
817
> 
818
> 
819
> 
820
> 
821
> cleanEx()
822
> nameEx("showNonASCII")
823
> ### * showNonASCII
824
> 
825
> flush(stderr()); flush(stdout())
826
> 
827
> ### Name: showNonASCII
828
> ### Title: Pick Out Non-ASCII Characters
829
> ### Aliases: showNonASCII showNonASCIIfile
830
> ### Keywords: utilities
831
> 
832
> ### ** Examples
833
> 
834
> out <- c(
835
+ "fa\xE7ile test of showNonASCII():",
836
+ "\\details{",
837
+ "   This is a good line",
838
+ "   This has an \xfcmlaut in it.",
839
+ "   OK again.",
840
+ "}")
841
> f <- tempfile()
842
> cat(out, file = f, sep = "\n")
843
> 
844
> showNonASCIIfile(f)
845
1: fa<e7>ile test of showNonASCII():
846
4:    This has an <fc>mlaut in it.
847
> unlink(f)
848
> 
849
> 
850
> 
851
> cleanEx()
852
> nameEx("toHTML")
853
> ### * toHTML
854
> 
855
> flush(stderr()); flush(stdout())
856
> 
857
> ### Name: toHTML
858
> ### Title: Display an object in HTML.
859
> ### Aliases: toHTML toHTML.packageIQR toHTML.news_db
860
> ### Keywords: utilities documentation
861
> 
862
> ### ** Examples
863
> 
61161 ripley 864
> cat(toHTML(demo(package = "base")), sep = "\n")
56186 murdoch 865
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
866
<html><head><title>R: R</title>
867
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
868
<link rel="stylesheet" type="text/css" href="/doc/html/R.css">
869
</head><body>
870
<h1> R
56582 murdoch 871
<img class="toplogo" src="/doc/html/logo.jpg" alt="[R logo]">
56186 murdoch 872
</h1>
873
<hr>
874
<div align="center">
875
<a href="/doc/html/index.html"><img src="/doc/html/up.jpg" alt="[Top]" width="30" height="30" border="0"></a>
876
</div>
877
<h2>Demos in package &lsquo;base&rsquo;</h2>
878
<table cols="2" width="100%">
879
<tr>
880
 <td align="left" valign="top" width="10%">
881
error.catching
882
 </td>
883
 <td align="left" valign="top" width="90%">
884
More examples on catching and handling errors
885
 </td>
886
</tr>
887
 
888
<tr>
889
 <td align="left" valign="top" width="10%">
890
is.things
891
 </td>
892
 <td align="left" valign="top" width="90%">
893
Explore some properties of R objects and is.FOO() functions. Not for newbies!
894
 </td>
895
</tr>
896
 
897
<tr>
898
 <td align="left" valign="top" width="10%">
899
recursion
900
 </td>
901
 <td align="left" valign="top" width="90%">
902
Using recursion for adaptive integration
903
 </td>
904
</tr>
905
 
906
<tr>
907
 <td align="left" valign="top" width="10%">
908
scoping
909
 </td>
910
 <td align="left" valign="top" width="90%">
911
An illustration of lexical scoping.
912
 </td>
913
</tr>
914
 
915
</table>
916
<p>
917
</p>
918
</body></html>
919
> 
920
> 
921
> 
922
> cleanEx()
923
> nameEx("undoc")
924
> ### * undoc
925
> 
926
> flush(stderr()); flush(stdout())
927
> 
928
> ### Name: undoc
929
> ### Title: Find Undocumented Objects
930
> ### Aliases: undoc print.undoc
931
> ### Keywords: documentation
932
> 
933
> ### ** Examples
934
> 
935
> undoc("tools")                  # Undocumented objects in 'tools'
936
> 
937
> 
938
> 
939
> cleanEx()
940
> nameEx("vignetteDepends")
941
> ### * vignetteDepends
942
> 
943
> flush(stderr()); flush(stdout())
944
> 
945
> ### Name: vignetteDepends
946
> ### Title: Retrieve Dependency Information for a Vignette
947
> ### Aliases: vignetteDepends
948
> ### Keywords: utilities
949
> 
950
> ### ** Examples
951
> 
952
> ## This may not be installed
953
> gridEx <- system.file("doc", "grid.Rnw", package = "grid")
954
> vignetteDepends(gridEx)
955
$Depends
956
[1] "lattice"
957
 
958
$Installed
959
[1] "lattice"
960
 
961
$Found
962
list()
963
 
964
$NotFound
965
character(0)
966
 
967
$R
61601 ripley 968
[1] "R (>= 2.15.1)"
56186 murdoch 969
 
970
attr(,"class")
971
[1] "DependsList" "list"       
972
> 
973
> 
974
> 
975
> cleanEx()
61822 murdoch 976
> nameEx("vignetteEngine")
977
> ### * vignetteEngine
978
> 
979
> flush(stderr()); flush(stdout())
980
> 
981
> ### Name: vignetteEngine
62277 ripley 982
> ### Title: Set or Get a Vignette Processing Engine
61822 murdoch 983
> ### Aliases: vignetteEngine
984
> ### Keywords: utilities documentation
985
> 
986
> ### ** Examples
987
> 
988
> str(vignetteEngine("Sweave"))
63202 ripley 989
List of 6
62138 ripley 990
 $ name   : chr "Sweave"
991
 $ package: chr "utils"
992
 $ pattern: chr "[.][rRsS](nw|tex)$"
993
 $ weave  :function (...)  
994
 $ tangle :function (...)  
63202 ripley 995
 $ aspell :List of 2
996
  ..$ filter : chr "Sweave"
997
  ..$ control: chr "-t"
61822 murdoch 998
> 
999
> 
1000
> 
1001
> cleanEx()
56186 murdoch 1002
> nameEx("writePACKAGES")
1003
> ### * writePACKAGES
1004
> 
1005
> flush(stderr()); flush(stdout())
1006
> 
1007
> ### Name: write_PACKAGES
1008
> ### Title: Generate PACKAGES files
1009
> ### Aliases: write_PACKAGES
1010
> ### Keywords: file utilities
1011
> 
1012
> ### ** Examples
1013
> 
1014
> ## Not run: 
1015
> ##D write_PACKAGES("c:/myFolder/myRepository")  # on Windows
1016
> ##D write_PACKAGES("/pub/RWin/bin/windows/contrib/2.9",
61161 ripley 1017
> ##D                type = "win.binary")  # on Linux
56186 murdoch 1018
> ## End(Not run)
1019
> 
1020
> 
1021
> cleanEx()
1022
> nameEx("xgettext")
1023
> ### * xgettext
1024
> 
1025
> flush(stderr()); flush(stdout())
1026
> 
1027
> ### Name: xgettext
1028
> ### Title: Extract Translatable Messages from R Files in a Package
1029
> ### Aliases: xgettext xngettext xgettext2pot
1030
> ### Keywords: utilities
1031
> 
1032
> ### ** Examples
1033
> ## Not run: 
1034
> ##D ## in a source-directory build of R:
1035
> ##D xgettext(file.path(R.home(), "src", "library", "splines"))
1036
> ## End(Not run)
1037
> 
1038
> 
1039
> ### * <FOOTER>
1040
> ###
62439 ripley 1041
> options(digits = 7L)
61787 ripley 1042
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
63202 ripley 1043
Time elapsed:  0.247 0.005 0.254 0 0 
56186 murdoch 1044
> grDevices::dev.off()
1045
null device 
1046
          1 
1047
> ###
1048
> ### Local variables: ***
1049
> ### mode: outline-minor ***
1050
> ### outline-regexp: "\\(> \\)?### [*]+" ***
1051
> ### End: ***
1052
> quit('no')