The R Project SVN R

Rev

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

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