The R Project SVN R

Rev

Rev 52081 | Rev 52339 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 52081 Rev 52082
Line 1... Line 1...
1
 
1
 
2
R version 2.12.0 Under development (unstable) (2010-05-23 r52077)
2
R version 2.12.0 Under development (unstable) (2010-05-23 r52077)
3
Copyright (C) 2010 The R Foundation for Statistical Computing
3
Copyright (C) 2010 The R Foundation for Statistical Computing
4
ISBN 3-900051-07-0
4
ISBN 3-900051-07-0
5
Platform: i386-pc-mingw32/i386 (32-bit)
5
Platform: i386-pc-mingw32/i386 (32-bit)
6
 
6
 
7
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
R is free software and comes with ABSOLUTELY NO WARRANTY.
8
You are welcome to redistribute it under certain conditions.
8
You are welcome to redistribute it under certain conditions.
9
Type 'license()' or 'licence()' for distribution details.
9
Type 'license()' or 'licence()' for distribution details.
10
 
10
 
11
  Natural language support but running in an English locale
11
  Natural language support but running in an English locale
12
 
12
 
13
R is a collaborative project with many contributors.
13
R is a collaborative project with many contributors.
14
Type 'contributors()' for more information and
14
Type 'contributors()' for more information and
15
'citation()' on how to cite R or R packages in publications.
15
'citation()' on how to cite R or R packages in publications.
16
 
16
 
17
Type 'demo()' for some demos, 'help()' for on-line help, or
17
Type 'demo()' for some demos, 'help()' for on-line help, or
18
'help.start()' for an HTML browser interface to help.
18
'help.start()' for an HTML browser interface to help.
19
Type 'q()' to quit R.
19
Type 'q()' to quit R.
20
 
20
 
21
> pkgname <- "grDevices"
21
> pkgname <- "grDevices"
22
> source(file.path(R.home("share"), "R", "examples-header.R"))
22
> source(file.path(R.home("share"), "R", "examples-header.R"))
23
> options(warn = 1)
23
> options(warn = 1)
24
> options(pager = "console")
24
> library('grDevices')
25
> library('grDevices')
25
> 
26
> 
26
> assign(".oldSearch", search(), pos = 'CheckExEnv')
27
> assign(".oldSearch", search(), pos = 'CheckExEnv')
27
> cleanEx()
28
> cleanEx()
28
> nameEx("Devices")
29
> nameEx("Devices")
29
> ### * Devices
30
> ### * Devices
30
> 
31
> 
31
> flush(stderr()); flush(stdout())
32
> flush(stderr()); flush(stdout())
32
> 
33
> 
33
> ### Name: Devices
34
> ### Name: Devices
34
> ### Title: List of Graphical Devices
35
> ### Title: List of Graphical Devices
35
> ### Aliases: Devices device
36
> ### Aliases: Devices device
36
> ### Keywords: device
37
> ### Keywords: device
37
> 
38
> 
38
> ### ** Examples
39
> ### ** Examples
39
> ## Not run: 
40
> ## Not run: 
40
> ##D ## open the default screen device on this platform if no device is
41
> ##D ## open the default screen device on this platform if no device is
41
> ##D ## open
42
> ##D ## open
42
> ##D if(dev.cur() == 1) dev.new()
43
> ##D if(dev.cur() == 1) dev.new()
43
> ## End(Not run)
44
> ## End(Not run)
44
> 
45
> 
45
> 
46
> 
46
> cleanEx()
47
> cleanEx()
47
> nameEx("Hershey")
48
> nameEx("Hershey")
48
> ### * Hershey
49
> ### * Hershey
49
> 
50
> 
50
> flush(stderr()); flush(stdout())
51
> flush(stderr()); flush(stdout())
51
> 
52
> 
52
> ### Name: Hershey
53
> ### Name: Hershey
53
> ### Title: Hershey Vector Fonts in R
54
> ### Title: Hershey Vector Fonts in R
54
> ### Aliases: Hershey
55
> ### Aliases: Hershey
55
> ### Keywords: aplot
56
> ### Keywords: aplot
56
> 
57
> 
57
> ### ** Examples
58
> ### ** Examples
58
> 
59
> 
59
> Hershey
60
> Hershey
60
$typeface
61
$typeface
61
[1] "serif"             "sans serif"        "script"           
62
[1] "serif"             "sans serif"        "script"           
62
[4] "gothic english"    "gothic german"     "gothic italian"   
63
[4] "gothic english"    "gothic german"     "gothic italian"   
63
[7] "serif symbol"      "sans serif symbol"
64
[7] "serif symbol"      "sans serif symbol"
64
 
65
 
65
$fontindex
66
$fontindex
66
[1] "plain"            "italic"           "bold"             "bold italic"     
67
[1] "plain"            "italic"           "bold"             "bold italic"     
67
[5] "cyrillic"         "oblique cyrillic" "EUC"             
68
[5] "cyrillic"         "oblique cyrillic" "EUC"             
68
 
69
 
69
$allowed
70
$allowed
70
      [,1] [,2]
71
      [,1] [,2]
71
 [1,]    1    1
72
 [1,]    1    1
72
 [2,]    1    2
73
 [2,]    1    2
73
 [3,]    1    3
74
 [3,]    1    3
74
 [4,]    1    4
75
 [4,]    1    4
75
 [5,]    1    5
76
 [5,]    1    5
76
 [6,]    1    6
77
 [6,]    1    6
77
 [7,]    1    7
78
 [7,]    1    7
78
 [8,]    2    1
79
 [8,]    2    1
79
 [9,]    2    2
80
 [9,]    2    2
80
[10,]    2    3
81
[10,]    2    3
81
[11,]    2    4
82
[11,]    2    4
82
[12,]    3    1
83
[12,]    3    1
83
[13,]    3    2
84
[13,]    3    2
84
[14,]    3    3
85
[14,]    3    3
85
[15,]    4    1
86
[15,]    4    1
86
[16,]    5    1
87
[16,]    5    1
87
[17,]    6    1
88
[17,]    6    1
88
[18,]    7    1
89
[18,]    7    1
89
[19,]    7    2
90
[19,]    7    2
90
[20,]    7    3
91
[20,]    7    3
91
[21,]    7    4
92
[21,]    7    4
92
[22,]    8    1
93
[22,]    8    1
93
[23,]    8    2
94
[23,]    8    2
94
 
95
 
95
> 
96
> 
96
> ## for tables of examples, see demo(Hershey)
97
> ## for tables of examples, see demo(Hershey)
97
> 
98
> 
98
> 
99
> 
99
> 
100
> 
100
> cleanEx()
101
> cleanEx()
101
> nameEx("Japanese")
102
> nameEx("Japanese")
102
> ### * Japanese
103
> ### * Japanese
103
> 
104
> 
104
> flush(stderr()); flush(stdout())
105
> flush(stderr()); flush(stdout())
105
> 
106
> 
106
> ### Name: Japanese
107
> ### Name: Japanese
107
> ### Title: Japanese characters in R
108
> ### Title: Japanese characters in R
108
> ### Aliases: Japanese
109
> ### Aliases: Japanese
109
> ### Keywords: aplot
110
> ### Keywords: aplot
110
> 
111
> 
111
> ### ** Examples
112
> ### ** Examples
112
> 
113
> 
113
> require(graphics)
114
> require(graphics)
114
> 
115
> 
115
> plot(1:9, type="n", axes=FALSE, frame=TRUE, ylab="",
116
> plot(1:9, type="n", axes=FALSE, frame=TRUE, ylab="",
116
+      main= "example(Japanese)", xlab= "using Hershey fonts")
117
+      main= "example(Japanese)", xlab= "using Hershey fonts")
117
> par(cex=3)
118
> par(cex=3)
118
> Vf <- c("serif", "plain")
119
> Vf <- c("serif", "plain")
119
> text(4, 2, "\\#J2438\\#J2421\\#J2451\\#J2473", vfont = Vf)
120
> text(4, 2, "\\#J2438\\#J2421\\#J2451\\#J2473", vfont = Vf)
120
> text(4, 4, "\\#J2538\\#J2521\\#J2551\\#J2573", vfont = Vf)
121
> text(4, 4, "\\#J2538\\#J2521\\#J2551\\#J2573", vfont = Vf)
121
> text(4, 6, "\\#J467c\\#J4b5c", vfont = Vf)
122
> text(4, 6, "\\#J467c\\#J4b5c", vfont = Vf)
122
> text(4, 8, "Japan", vfont = Vf)
123
> text(4, 8, "Japan", vfont = Vf)
123
> par(cex=1)
124
> par(cex=1)
124
> text(8, 2, "Hiragana")
125
> text(8, 2, "Hiragana")
125
> text(8, 4, "Katakana")
126
> text(8, 4, "Katakana")
126
> text(8, 6, "Kanji")
127
> text(8, 6, "Kanji")
127
> text(8, 8, "English")
128
> text(8, 8, "English")
128
> 
129
> 
129
> 
130
> 
130
> 
131
> 
131
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
132
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
132
> cleanEx()
133
> cleanEx()
133
> nameEx("Type1Font")
134
> nameEx("Type1Font")
134
> ### * Type1Font
135
> ### * Type1Font
135
> 
136
> 
136
> flush(stderr()); flush(stdout())
137
> flush(stderr()); flush(stdout())
137
> 
138
> 
138
> ### Name: Type1Font
139
> ### Name: Type1Font
139
> ### Title: Type 1 and CID Fonts
140
> ### Title: Type 1 and CID Fonts
140
> ### Aliases: Type1Font CIDFont
141
> ### Aliases: Type1Font CIDFont
141
> ### Keywords: device
142
> ### Keywords: device
142
> 
143
> 
143
> ### ** Examples
144
> ### ** Examples
144
> 
145
> 
145
> ## This duplicates "ComputerModernItalic".
146
> ## This duplicates "ComputerModernItalic".
146
> CMitalic <- Type1Font("ComputerModern2",
147
> CMitalic <- Type1Font("ComputerModern2",
147
+                       c("CM_regular_10.afm", "CM_boldx_10.afm",
148
+                       c("CM_regular_10.afm", "CM_boldx_10.afm",
148
+                         "cmti10.afm", "cmbxti10.afm",
149
+                         "cmti10.afm", "cmbxti10.afm",
149
+                         "CM_symbol_10.afm"),
150
+                         "CM_symbol_10.afm"),
150
+                       encoding = "TeXtext.enc")
151
+                       encoding = "TeXtext.enc")
151
> 
152
> 
152
> ## Not run: 
153
> ## Not run: 
153
> ##D ## This could be used by
154
> ##D ## This could be used by
154
> ##D postscript(family = CMitalic)
155
> ##D postscript(family = CMitalic)
155
> ##D ## or
156
> ##D ## or
156
> ##D postscriptFonts(CMitalic = CMitalic)  # once in a session
157
> ##D postscriptFonts(CMitalic = CMitalic)  # once in a session
157
> ##D postscript(family = "CMitalic", encoding = "TeXtext.enc")
158
> ##D postscript(family = "CMitalic", encoding = "TeXtext.enc")
158
> ## End(Not run)
159
> ## End(Not run)
159
> 
160
> 
160
> 
161
> 
161
> cleanEx()
162
> cleanEx()
162
> nameEx("as.raster")
163
> nameEx("as.raster")
163
> ### * as.raster
164
> ### * as.raster
164
> 
165
> 
165
> flush(stderr()); flush(stdout())
166
> flush(stderr()); flush(stdout())
166
> 
167
> 
167
> ### Name: as.raster
168
> ### Name: as.raster
168
> ### Title: Create a Raster Object
169
> ### Title: Create a Raster Object
169
> ### Aliases: is.raster as.raster as.raster.logical as.raster.numeric
170
> ### Aliases: is.raster as.raster as.raster.logical as.raster.numeric
170
> ###   as.raster.character as.raster.matrix as.raster.array
171
> ###   as.raster.character as.raster.matrix as.raster.array
171
> ### Keywords: dplot
172
> ### Keywords: dplot
172
> 
173
> 
173
> ### ** Examples
174
> ### ** Examples
174
> 
175
> 
175
> # A red gradient
176
> # A red gradient
176
> as.raster(matrix(hcl(0, 80, seq(50, 80, 10)),
177
> as.raster(matrix(hcl(0, 80, seq(50, 80, 10)),
177
+                  nrow=4, ncol=5))
178
+                  nrow=4, ncol=5))
178
     [,1]      [,2]      [,3]      [,4]      [,5]     
179
     [,1]      [,2]      [,3]      [,4]      [,5]     
179
[1,] "#C54E6D" "#C54E6D" "#C54E6D" "#C54E6D" "#C54E6D"
180
[1,] "#C54E6D" "#C54E6D" "#C54E6D" "#C54E6D" "#C54E6D"
180
[2,] "#E16A86" "#E16A86" "#E16A86" "#E16A86" "#E16A86"
181
[2,] "#E16A86" "#E16A86" "#E16A86" "#E16A86" "#E16A86"
181
[3,] "#FE86A1" "#FE86A1" "#FE86A1" "#FE86A1" "#FE86A1"
182
[3,] "#FE86A1" "#FE86A1" "#FE86A1" "#FE86A1" "#FE86A1"
182
[4,] "#FFA2BC" "#FFA2BC" "#FFA2BC" "#FFA2BC" "#FFA2BC"
183
[4,] "#FFA2BC" "#FFA2BC" "#FFA2BC" "#FFA2BC" "#FFA2BC"
183
> 
184
> 
184
> # Vectors are 1-column matrices ...
185
> # Vectors are 1-column matrices ...
185
> #   character vectors are color names ...
186
> #   character vectors are color names ...
186
> as.raster(hcl(0, 80, seq(50, 80, 10)))
187
> as.raster(hcl(0, 80, seq(50, 80, 10)))
187
     [,1]     
188
     [,1]     
188
[1,] "#C54E6D"
189
[1,] "#C54E6D"
189
[2,] "#E16A86"
190
[2,] "#E16A86"
190
[3,] "#FE86A1"
191
[3,] "#FE86A1"
191
[4,] "#FFA2BC"
192
[4,] "#FFA2BC"
192
> #   numeric vectors are greyscale ...
193
> #   numeric vectors are greyscale ...
193
> as.raster(1:5, max=5)
194
> as.raster(1:5, max=5)
194
     [,1]     
195
     [,1]     
195
[1,] "#333333"
196
[1,] "#333333"
196
[2,] "#666666"
197
[2,] "#666666"
197
[3,] "#999999"
198
[3,] "#999999"
198
[4,] "#CCCCCC"
199
[4,] "#CCCCCC"
199
[5,] "#FFFFFF"
200
[5,] "#FFFFFF"
200
> #   locigal vectors are black and white ...
201
> #   locigal vectors are black and white ...
201
> as.raster(1:10 %% 2 == 0)
202
> as.raster(1:10 %% 2 == 0)
202
      [,1]     
203
      [,1]     
203
 [1,] "#000000"
204
 [1,] "#000000"
204
 [2,] "#FFFFFF"
205
 [2,] "#FFFFFF"
205
 [3,] "#000000"
206
 [3,] "#000000"
206
 [4,] "#FFFFFF"
207
 [4,] "#FFFFFF"
207
 [5,] "#000000"
208
 [5,] "#000000"
208
 [6,] "#FFFFFF"
209
 [6,] "#FFFFFF"
209
 [7,] "#000000"
210
 [7,] "#000000"
210
 [8,] "#FFFFFF"
211
 [8,] "#FFFFFF"
211
 [9,] "#000000"
212
 [9,] "#000000"
212
[10,] "#FFFFFF"
213
[10,] "#FFFFFF"
213
> 
214
> 
214
> # ... unless nrow/ncol are supplied ...
215
> # ... unless nrow/ncol are supplied ...
215
> as.raster(1:10 %% 2 == 0, nrow=1)
216
> as.raster(1:10 %% 2 == 0, nrow=1)
216
     [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]     
217
     [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]     
217
[1,] "#000000" "#FFFFFF" "#000000" "#FFFFFF" "#000000" "#FFFFFF" "#000000"
218
[1,] "#000000" "#FFFFFF" "#000000" "#FFFFFF" "#000000" "#FFFFFF" "#000000"
218
     [,8]      [,9]      [,10]    
219
     [,8]      [,9]      [,10]    
219
[1,] "#FFFFFF" "#000000" "#FFFFFF"
220
[1,] "#FFFFFF" "#000000" "#FFFFFF"
220
> 
221
> 
221
> # Matrix can also be logical or numeric ...
222
> # Matrix can also be logical or numeric ...
222
> as.raster(matrix(c(TRUE, FALSE), nrow=3, ncol=2))
223
> as.raster(matrix(c(TRUE, FALSE), nrow=3, ncol=2))
223
     [,1]      [,2]     
224
     [,1]      [,2]     
224
[1,] "#FFFFFF" "#000000"
225
[1,] "#FFFFFF" "#000000"
225
[2,] "#000000" "#FFFFFF"
226
[2,] "#000000" "#FFFFFF"
226
[3,] "#FFFFFF" "#000000"
227
[3,] "#FFFFFF" "#000000"
227
> as.raster(matrix(1:3/4, nrow=3, ncol=4))
228
> as.raster(matrix(1:3/4, nrow=3, ncol=4))
228
     [,1]      [,2]      [,3]      [,4]     
229
     [,1]      [,2]      [,3]      [,4]     
229
[1,] "#404040" "#404040" "#404040" "#404040"
230
[1,] "#404040" "#404040" "#404040" "#404040"
230
[2,] "#808080" "#808080" "#808080" "#808080"
231
[2,] "#808080" "#808080" "#808080" "#808080"
231
[3,] "#BFBFBF" "#BFBFBF" "#BFBFBF" "#BFBFBF"
232
[3,] "#BFBFBF" "#BFBFBF" "#BFBFBF" "#BFBFBF"
232
> 
233
> 
233
> # An array can be 3-plane numeric (R, G, B planes) ...
234
> # An array can be 3-plane numeric (R, G, B planes) ...
234
> as.raster(array(c(0:1, rep(0.5, 4)), c(2, 1, 3)))
235
> as.raster(array(c(0:1, rep(0.5, 4)), c(2, 1, 3)))
235
     [,1]     
236
     [,1]     
236
[1,] "#008080"
237
[1,] "#008080"
237
[2,] "#FF8080"
238
[2,] "#FF8080"
238
> 
239
> 
239
> # ... or 4-plane numeric (R, G, B, A planes)
240
> # ... or 4-plane numeric (R, G, B, A planes)
240
> as.raster(array(c(0:1, rep(0.5, 6)), c(2, 1, 4)))
241
> as.raster(array(c(0:1, rep(0.5, 6)), c(2, 1, 4)))
241
     [,1]       
242
     [,1]       
242
[1,] "#00808080"
243
[1,] "#00808080"
243
[2,] "#FF808080"
244
[2,] "#FF808080"
244
> 
245
> 
245
> 
246
> 
246
> 
247
> 
247
> 
248
> 
248
> cleanEx()
249
> cleanEx()
249
> nameEx("boxplot.stats")
250
> nameEx("boxplot.stats")
250
> ### * boxplot.stats
251
> ### * boxplot.stats
251
> 
252
> 
252
> flush(stderr()); flush(stdout())
253
> flush(stderr()); flush(stdout())
253
> 
254
> 
254
> ### Name: boxplot.stats
255
> ### Name: boxplot.stats
255
> ### Title: Box Plot Statistics
256
> ### Title: Box Plot Statistics
256
> ### Aliases: boxplot.stats
257
> ### Aliases: boxplot.stats
257
> ### Keywords: dplot
258
> ### Keywords: dplot
258
> 
259
> 
259
> ### ** Examples
260
> ### ** Examples
260
> 
261
> 
261
> require(stats)
262
> require(stats)
262
> x <- c(1:100, 1000)
263
> x <- c(1:100, 1000)
263
> (b1 <- boxplot.stats(x))
264
> (b1 <- boxplot.stats(x))
264
$stats
265
$stats
265
[1]   1  26  51  76 100
266
[1]   1  26  51  76 100
266
 
267
 
267
$n
268
$n
268
[1] 101
269
[1] 101
269
 
270
 
270
$conf
271
$conf
271
[1] 43.13921 58.86079
272
[1] 43.13921 58.86079
272
 
273
 
273
$out
274
$out
274
[1] 1000
275
[1] 1000
275
 
276
 
276
> (b2 <- boxplot.stats(x, do.conf=FALSE, do.out=FALSE))
277
> (b2 <- boxplot.stats(x, do.conf=FALSE, do.out=FALSE))
277
$stats
278
$stats
278
[1]   1  26  51  76 100
279
[1]   1  26  51  76 100
279
 
280
 
280
$n
281
$n
281
[1] 101
282
[1] 101
282
 
283
 
283
$conf
284
$conf
284
NULL
285
NULL
285
 
286
 
286
$out
287
$out
287
numeric(0)
288
numeric(0)
288
 
289
 
289
> stopifnot(b1 $ stats == b2 $ stats) # do.out=F is still robust
290
> stopifnot(b1 $ stats == b2 $ stats) # do.out=F is still robust
290
> boxplot.stats(x, coef = 3, do.conf=FALSE)
291
> boxplot.stats(x, coef = 3, do.conf=FALSE)
291
$stats
292
$stats
292
[1]   1  26  51  76 100
293
[1]   1  26  51  76 100
293
 
294
 
294
$n
295
$n
295
[1] 101
296
[1] 101
296
 
297
 
297
$conf
298
$conf
298
NULL
299
NULL
299
 
300
 
300
$out
301
$out
301
[1] 1000
302
[1] 1000
302
 
303
 
303
> ## no outlier treatment:
304
> ## no outlier treatment:
304
> boxplot.stats(x, coef = 0)
305
> boxplot.stats(x, coef = 0)
305
$stats
306
$stats
306
[1]    1   26   51   76 1000
307
[1]    1   26   51   76 1000
307
 
308
 
308
$n
309
$n
309
[1] 101
310
[1] 101
310
 
311
 
311
$conf
312
$conf
312
[1] 43.13921 58.86079
313
[1] 43.13921 58.86079
313
 
314
 
314
$out
315
$out
315
numeric(0)
316
numeric(0)
316
 
317
 
317
> 
318
> 
318
> boxplot.stats(c(x, NA)) # slight change : n is 101
319
> boxplot.stats(c(x, NA)) # slight change : n is 101
319
$stats
320
$stats
320
[1]   1  26  51  76 100
321
[1]   1  26  51  76 100
321
 
322
 
322
$n
323
$n
323
[1] 101
324
[1] 101
324
 
325
 
325
$conf
326
$conf
326
[1] 43.13921 58.86079
327
[1] 43.13921 58.86079
327
 
328
 
328
$out
329
$out
329
[1] 1000
330
[1] 1000
330
 
331
 
331
> (r <- boxplot.stats(c(x, -1:1/0)))
332
> (r <- boxplot.stats(c(x, -1:1/0)))
332
$stats
333
$stats
333
[1]   1.0  25.5  51.0  76.5 100.0
334
[1]   1.0  25.5  51.0  76.5 100.0
334
 
335
 
335
$n
336
$n
336
[1] 103
337
[1] 103
337
 
338
 
338
$conf
339
$conf
339
[1] 43.06022 58.93978
340
[1] 43.06022 58.93978
340
 
341
 
341
$out
342
$out
342
[1] 1000 -Inf  Inf
343
[1] 1000 -Inf  Inf
343
 
344
 
344
> stopifnot(r$out == c(1000, -Inf, Inf))
345
> stopifnot(r$out == c(1000, -Inf, Inf))
345
> 
346
> 
346
> ## Don't show: 
347
> ## Don't show: 
347
>  ## Difference between quartiles and hinges :
348
>  ## Difference between quartiles and hinges :
348
>  nn <- 1:17 ;  n4 <- nn %% 4
349
>  nn <- 1:17 ;  n4 <- nn %% 4
349
>  hin <- sapply(sapply(nn, seq), function(x) boxplot.stats(x)$stats[c(2,4)])
350
>  hin <- sapply(sapply(nn, seq), function(x) boxplot.stats(x)$stats[c(2,4)])
350
>  q13 <- sapply(sapply(nn, seq), quantile, probs = c(1,3)/4, names = FALSE)
351
>  q13 <- sapply(sapply(nn, seq), quantile, probs = c(1,3)/4, names = FALSE)
351
>  m <- t(rbind(q13,hin))[, c(1,3,2,4)]
352
>  m <- t(rbind(q13,hin))[, c(1,3,2,4)]
352
>  dimnames(m) <- list(paste(nn), c("q1","lH", "q3","uH"))
353
>  dimnames(m) <- list(paste(nn), c("q1","lH", "q3","uH"))
353
>  stopifnot(m[n4==1, 1:2] == (nn[n4==1] + 3)/4,# quart. = hinge
354
>  stopifnot(m[n4==1, 1:2] == (nn[n4==1] + 3)/4,# quart. = hinge
354
+            m[n4==1, 3:4] == (3*nn[n4==1]+1)/4,
355
+            m[n4==1, 3:4] == (3*nn[n4==1]+1)/4,
355
+            m[,"lH"] == ( (nn+3) %/% 2) / 2,
356
+            m[,"lH"] == ( (nn+3) %/% 2) / 2,
356
+            m[,"uH"] == ((3*nn+2)%/% 2) / 2)
357
+            m[,"uH"] == ((3*nn+2)%/% 2) / 2)
357
>  cm <- noquote(format(m))
358
>  cm <- noquote(format(m))
358
>  cm[m[,2] == m[,1], 2] <- " = "
359
>  cm[m[,2] == m[,1], 2] <- " = "
359
>  cm[m[,4] == m[,3], 4] <- " = "
360
>  cm[m[,4] == m[,3], 4] <- " = "
360
>  cm
361
>  cm
361
   q1    lH    q3    uH   
362
   q1    lH    q3    uH   
362
1   1.00  =     1.00  =   
363
1   1.00  =     1.00  =   
363
2   1.25  1.00  1.75  2.00
364
2   1.25  1.00  1.75  2.00
364
3   1.50  =     2.50  =   
365
3   1.50  =     2.50  =   
365
4   1.75  1.50  3.25  3.50
366
4   1.75  1.50  3.25  3.50
366
5   2.00  =     4.00  =   
367
5   2.00  =     4.00  =   
367
6   2.25  2.00  4.75  5.00
368
6   2.25  2.00  4.75  5.00
368
7   2.50  =     5.50  =   
369
7   2.50  =     5.50  =   
369
8   2.75  2.50  6.25  6.50
370
8   2.75  2.50  6.25  6.50
370
9   3.00  =     7.00  =   
371
9   3.00  =     7.00  =   
371
10  3.25  3.00  7.75  8.00
372
10  3.25  3.00  7.75  8.00
372
11  3.50  =     8.50  =   
373
11  3.50  =     8.50  =   
373
12  3.75  3.50  9.25  9.50
374
12  3.75  3.50  9.25  9.50
374
13  4.00  =    10.00  =   
375
13  4.00  =    10.00  =   
375
14  4.25  4.00 10.75 11.00
376
14  4.25  4.00 10.75 11.00
376
15  4.50  =    11.50  =   
377
15  4.50  =    11.50  =   
377
16  4.75  4.50 12.25 12.50
378
16  4.75  4.50 12.25 12.50
378
17  5.00  =    13.00  =   
379
17  5.00  =    13.00  =   
379
> ## End Don't show
380
> ## End Don't show
380
> 
381
> 
381
> 
382
> 
382
> 
383
> 
383
> 
384
> 
384
> cleanEx()
385
> cleanEx()
385
> nameEx("check.options")
386
> nameEx("check.options")
386
> ### * check.options
387
> ### * check.options
387
> 
388
> 
388
> flush(stderr()); flush(stdout())
389
> flush(stderr()); flush(stdout())
389
> 
390
> 
390
> ### Name: check.options
391
> ### Name: check.options
391
> ### Title: Set Options with Consistency Checks
392
> ### Title: Set Options with Consistency Checks
392
> ### Aliases: check.options
393
> ### Aliases: check.options
393
> ### Keywords: utilities programming
394
> ### Keywords: utilities programming
394
> 
395
> 
395
> ### ** Examples
396
> ### ** Examples
396
> 
397
> 
397
> (L1 <- list(a=1:3, b=pi, ch="CH"))
398
> (L1 <- list(a=1:3, b=pi, ch="CH"))
398
$a
399
$a
399
[1] 1 2 3
400
[1] 1 2 3
400
 
401
 
401
$b
402
$b
402
[1] 3.141593
403
[1] 3.141593
403
 
404
 
404
$ch
405
$ch
405
[1] "CH"
406
[1] "CH"
406
 
407
 
407
> check.options(list(a=0:2), name.opt = "L1")
408
> check.options(list(a=0:2), name.opt = "L1")
408
$a
409
$a
409
[1] 0 1 2
410
[1] 0 1 2
410
 
411
 
411
$b
412
$b
412
[1] 3.141593
413
[1] 3.141593
413
 
414
 
414
$ch
415
$ch
415
[1] "CH"
416
[1] "CH"
416
 
417
 
417
> check.options(NULL, reset = TRUE, name.opt = "L1")
418
> check.options(NULL, reset = TRUE, name.opt = "L1")
418
$a
419
$a
419
[1] 1 2 3
420
[1] 1 2 3
420
 
421
 
421
$b
422
$b
422
[1] 3.141593
423
[1] 3.141593
423
 
424
 
424
$ch
425
$ch
425
[1] "CH"
426
[1] "CH"
426
 
427
 
427
> 
428
> 
428
> 
429
> 
429
> 
430
> 
430
> cleanEx()
431
> cleanEx()
431
> nameEx("chull")
432
> nameEx("chull")
432
> ### * chull
433
> ### * chull
433
> 
434
> 
434
> flush(stderr()); flush(stdout())
435
> flush(stderr()); flush(stdout())
435
> 
436
> 
436
> ### Name: chull
437
> ### Name: chull
437
> ### Title: Compute Convex Hull of a Set of Points
438
> ### Title: Compute Convex Hull of a Set of Points
438
> ### Aliases: chull
439
> ### Aliases: chull
439
> ### Keywords: graphs
440
> ### Keywords: graphs
440
> 
441
> 
441
> ### ** Examples
442
> ### ** Examples
442
> 
443
> 
443
> require(stats)
444
> require(stats)
444
> X <- matrix(rnorm(2000), ncol = 2)
445
> X <- matrix(rnorm(2000), ncol = 2)
445
> chull(X)
446
> chull(X)
446
 [1]  61 442 165 899 697 446 975 656 232 557 938 295 495
447
 [1]  61 442 165 899 697 446 975 656 232 557 938 295 495
447
> ## Not run: 
448
> ## Not run: 
448
> ##D   # Example usage from graphics package
449
> ##D   # Example usage from graphics package
449
> ##D   plot(X, cex = 0.5)
450
> ##D   plot(X, cex = 0.5)
450
> ##D   hpts <- chull(X)
451
> ##D   hpts <- chull(X)
451
> ##D   hpts <- c(hpts, hpts[1])
452
> ##D   hpts <- c(hpts, hpts[1])
452
> ##D   lines(X[hpts, ])
453
> ##D   lines(X[hpts, ])
453
> ## End(Not run)
454
> ## End(Not run)
454
> 
455
> 
455
> 
456
> 
456
> 
457
> 
457
> cleanEx()
458
> cleanEx()
458
> nameEx("cm")
459
> nameEx("cm")
459
> ### * cm
460
> ### * cm
460
> 
461
> 
461
> flush(stderr()); flush(stdout())
462
> flush(stderr()); flush(stdout())
462
> 
463
> 
463
> ### Name: cm
464
> ### Name: cm
464
> ### Title: Unit Transformation
465
> ### Title: Unit Transformation
465
> ### Aliases: cm
466
> ### Aliases: cm
466
> ### Keywords: dplot
467
> ### Keywords: dplot
467
> 
468
> 
468
> ### ** Examples
469
> ### ** Examples
469
> 
470
> 
470
> cm(1)# = 2.54
471
> cm(1)# = 2.54
471
[1] 2.54
472
[1] 2.54
472
> 
473
> 
473
> ## Translate *from* cm *to* inches:
474
> ## Translate *from* cm *to* inches:
474
> 
475
> 
475
> 10 / cm(1) # -> 10cm  are 3.937 inches
476
> 10 / cm(1) # -> 10cm  are 3.937 inches
476
[1] 3.937008
477
[1] 3.937008
477
> 
478
> 
478
> 
479
> 
479
> 
480
> 
480
> cleanEx()
481
> cleanEx()
481
> nameEx("col2rgb")
482
> nameEx("col2rgb")
482
> ### * col2rgb
483
> ### * col2rgb
483
> 
484
> 
484
> flush(stderr()); flush(stdout())
485
> flush(stderr()); flush(stdout())
485
> 
486
> 
486
> ### Name: col2rgb
487
> ### Name: col2rgb
487
> ### Title: Color to RGB Conversion
488
> ### Title: Color to RGB Conversion
488
> ### Aliases: col2rgb
489
> ### Aliases: col2rgb
489
> ### Keywords: color dplot
490
> ### Keywords: color dplot
490
> 
491
> 
491
> ### ** Examples
492
> ### ** Examples
492
> 
493
> 
493
> col2rgb("peachpuff")
494
> col2rgb("peachpuff")
494
      [,1]
495
      [,1]
495
red    255
496
red    255
496
green  218
497
green  218
497
blue   185
498
blue   185
498
> col2rgb(c(blu = "royalblue", reddish = "tomato")) # names kept
499
> col2rgb(c(blu = "royalblue", reddish = "tomato")) # names kept
499
      blu reddish
500
      blu reddish
500
red    65     255
501
red    65     255
501
green 105      99
502
green 105      99
502
blue  225      71
503
blue  225      71
503
> 
504
> 
504
> col2rgb(1:8)# the ones from the palette() :
505
> col2rgb(1:8)# the ones from the palette() :
505
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
506
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
506
red      0  255    0    0    0  255  255  190
507
red      0  255    0    0    0  255  255  190
507
green    0    0  205    0  255    0  255  190
508
green    0    0  205    0  255    0  255  190
508
blue     0    0    0  255  255  255    0  190
509
blue     0    0    0  255  255  255    0  190
509
> 
510
> 
510
> col2rgb(paste("gold", 1:4, sep=""))
511
> col2rgb(paste("gold", 1:4, sep=""))
511
      [,1] [,2] [,3] [,4]
512
      [,1] [,2] [,3] [,4]
512
red    255  238  205  139
513
red    255  238  205  139
513
green  215  201  173  117
514
green  215  201  173  117
514
blue     0    0    0    0
515
blue     0    0    0    0
515
> 
516
> 
516
> col2rgb("#08a0ff")
517
> col2rgb("#08a0ff")
517
      [,1]
518
      [,1]
518
red      8
519
red      8
519
green  160
520
green  160
520
blue   255
521
blue   255
521
> ## all three kind of colors mixed :
522
> ## all three kind of colors mixed :
522
> col2rgb(c(red="red", palette= 1:3, hex="#abcdef"))
523
> col2rgb(c(red="red", palette= 1:3, hex="#abcdef"))
523
      red palette1 palette2 palette3 hex
524
      red palette1 palette2 palette3 hex
524
red   255        0      255        0 171
525
red   255        0      255        0 171
525
green   0        0        0      205 205
526
green   0        0        0      205 205
526
blue    0        0        0        0 239
527
blue    0        0        0        0 239
527
> 
528
> 
528
> ##-- NON-INTRODUCTORY examples --
529
> ##-- NON-INTRODUCTORY examples --
529
> 
530
> 
530
> grC <- col2rgb(paste("gray",0:100,sep=""))
531
> grC <- col2rgb(paste("gray",0:100,sep=""))
531
> table(print(diff(grC["red",])))# '2' or '3': almost equidistant
532
> table(print(diff(grC["red",])))# '2' or '3': almost equidistant
532
  [1] 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2
533
  [1] 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2
533
 [38] 3 2 3 3 2 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 3 2 3 2 3
534
 [38] 3 2 3 3 2 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 3 2 3 2 3
534
 [75] 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3
535
 [75] 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3 2 3 3 2 3 2 3 2 3 2 3
535
 
536
 
536
 2  3 
537
 2  3 
537
45 55 
538
45 55 
538
> ## The 'named' grays are in between {"slate gray" is not gray, strictly}
539
> ## The 'named' grays are in between {"slate gray" is not gray, strictly}
539
> col2rgb(c(g66="gray66", darkg= "dark gray", g67="gray67",
540
> col2rgb(c(g66="gray66", darkg= "dark gray", g67="gray67",
540
+           g74="gray74", gray =      "gray", g75="gray75",
541
+           g74="gray74", gray =      "gray", g75="gray75",
541
+           g82="gray82", light="light gray", g83="gray83"))
542
+           g82="gray82", light="light gray", g83="gray83"))
542
      g66 darkg g67 g74 gray g75 g82 light g83
543
      g66 darkg g67 g74 gray g75 g82 light g83
543
red   168   169 171 189  190 191 209   211 212
544
red   168   169 171 189  190 191 209   211 212
544
green 168   169 171 189  190 191 209   211 212
545
green 168   169 171 189  190 191 209   211 212
545
blue  168   169 171 189  190 191 209   211 212
546
blue  168   169 171 189  190 191 209   211 212
546
> 
547
> 
547
> crgb <- col2rgb(cc <- colors())
548
> crgb <- col2rgb(cc <- colors())
548
> colnames(crgb) <- cc
549
> colnames(crgb) <- cc
549
> t(crgb)## The whole table
550
> t(crgb)## The whole table
550
                     red green blue
551
                     red green blue
551
white                255   255  255
552
white                255   255  255
552
aliceblue            240   248  255
553
aliceblue            240   248  255
553
antiquewhite         250   235  215
554
antiquewhite         250   235  215
554
antiquewhite1        255   239  219
555
antiquewhite1        255   239  219
555
antiquewhite2        238   223  204
556
antiquewhite2        238   223  204
556
antiquewhite3        205   192  176
557
antiquewhite3        205   192  176
557
antiquewhite4        139   131  120
558
antiquewhite4        139   131  120
558
aquamarine           127   255  212
559
aquamarine           127   255  212
559
aquamarine1          127   255  212
560
aquamarine1          127   255  212
560
aquamarine2          118   238  198
561
aquamarine2          118   238  198
561
aquamarine3          102   205  170
562
aquamarine3          102   205  170
562
aquamarine4           69   139  116
563
aquamarine4           69   139  116
563
azure                240   255  255
564
azure                240   255  255
564
azure1               240   255  255
565
azure1               240   255  255
565
azure2               224   238  238
566
azure2               224   238  238
566
azure3               193   205  205
567
azure3               193   205  205
567
azure4               131   139  139
568
azure4               131   139  139
568
beige                245   245  220
569
beige                245   245  220
569
bisque               255   228  196
570
bisque               255   228  196
570
bisque1              255   228  196
571
bisque1              255   228  196
571
bisque2              238   213  183
572
bisque2              238   213  183
572
bisque3              205   183  158
573
bisque3              205   183  158
573
bisque4              139   125  107
574
bisque4              139   125  107
574
black                  0     0    0
575
black                  0     0    0
575
blanchedalmond       255   235  205
576
blanchedalmond       255   235  205
576
blue                   0     0  255
577
blue                   0     0  255
577
blue1                  0     0  255
578
blue1                  0     0  255
578
blue2                  0     0  238
579
blue2                  0     0  238
579
blue3                  0     0  205
580
blue3                  0     0  205
580
blue4                  0     0  139
581
blue4                  0     0  139
581
blueviolet           138    43  226
582
blueviolet           138    43  226
582
brown                165    42   42
583
brown                165    42   42
583
brown1               255    64   64
584
brown1               255    64   64
584
brown2               238    59   59
585
brown2               238    59   59
585
brown3               205    51   51
586
brown3               205    51   51
586
brown4               139    35   35
587
brown4               139    35   35
587
burlywood            222   184  135
588
burlywood            222   184  135
588
burlywood1           255   211  155
589
burlywood1           255   211  155
589
burlywood2           238   197  145
590
burlywood2           238   197  145
590
burlywood3           205   170  125
591
burlywood3           205   170  125
591
burlywood4           139   115   85
592
burlywood4           139   115   85
592
cadetblue             95   158  160
593
cadetblue             95   158  160
593
cadetblue1           152   245  255
594
cadetblue1           152   245  255
594
cadetblue2           142   229  238
595
cadetblue2           142   229  238
595
cadetblue3           122   197  205
596
cadetblue3           122   197  205
596
cadetblue4            83   134  139
597
cadetblue4            83   134  139
597
chartreuse           127   255    0
598
chartreuse           127   255    0
598
chartreuse1          127   255    0
599
chartreuse1          127   255    0
599
chartreuse2          118   238    0
600
chartreuse2          118   238    0
600
chartreuse3          102   205    0
601
chartreuse3          102   205    0
601
chartreuse4           69   139    0
602
chartreuse4           69   139    0
602
chocolate            210   105   30
603
chocolate            210   105   30
603
chocolate1           255   127   36
604
chocolate1           255   127   36
604
chocolate2           238   118   33
605
chocolate2           238   118   33
605
chocolate3           205   102   29
606
chocolate3           205   102   29
606
chocolate4           139    69   19
607
chocolate4           139    69   19
607
coral                255   127   80
608
coral                255   127   80
608
coral1               255   114   86
609
coral1               255   114   86
609
coral2               238   106   80
610
coral2               238   106   80
610
coral3               205    91   69
611
coral3               205    91   69
611
coral4               139    62   47
612
coral4               139    62   47
612
cornflowerblue       100   149  237
613
cornflowerblue       100   149  237
613
cornsilk             255   248  220
614
cornsilk             255   248  220
614
cornsilk1            255   248  220
615
cornsilk1            255   248  220
615
cornsilk2            238   232  205
616
cornsilk2            238   232  205
616
cornsilk3            205   200  177
617
cornsilk3            205   200  177
617
cornsilk4            139   136  120
618
cornsilk4            139   136  120
618
cyan                   0   255  255
619
cyan                   0   255  255
619
cyan1                  0   255  255
620
cyan1                  0   255  255
620
cyan2                  0   238  238
621
cyan2                  0   238  238
621
cyan3                  0   205  205
622
cyan3                  0   205  205
622
cyan4                  0   139  139
623
cyan4                  0   139  139
623
darkblue               0     0  139
624
darkblue               0     0  139
624
darkcyan               0   139  139
625
darkcyan               0   139  139
625
darkgoldenrod        184   134   11
626
darkgoldenrod        184   134   11
626
darkgoldenrod1       255   185   15
627
darkgoldenrod1       255   185   15
627
darkgoldenrod2       238   173   14
628
darkgoldenrod2       238   173   14
628
darkgoldenrod3       205   149   12
629
darkgoldenrod3       205   149   12
629
darkgoldenrod4       139   101    8
630
darkgoldenrod4       139   101    8
630
darkgray             169   169  169
631
darkgray             169   169  169
631
darkgreen              0   100    0
632
darkgreen              0   100    0
632
darkgrey             169   169  169
633
darkgrey             169   169  169
633
darkkhaki            189   183  107
634
darkkhaki            189   183  107
634
darkmagenta          139     0  139
635
darkmagenta          139     0  139
635
darkolivegreen        85   107   47
636
darkolivegreen        85   107   47
636
darkolivegreen1      202   255  112
637
darkolivegreen1      202   255  112
637
darkolivegreen2      188   238  104
638
darkolivegreen2      188   238  104
638
darkolivegreen3      162   205   90
639
darkolivegreen3      162   205   90
639
darkolivegreen4      110   139   61
640
darkolivegreen4      110   139   61
640
darkorange           255   140    0
641
darkorange           255   140    0
641
darkorange1          255   127    0
642
darkorange1          255   127    0
642
darkorange2          238   118    0
643
darkorange2          238   118    0
643
darkorange3          205   102    0
644
darkorange3          205   102    0
644
darkorange4          139    69    0
645
darkorange4          139    69    0
645
darkorchid           153    50  204
646
darkorchid           153    50  204
646
darkorchid1          191    62  255
647
darkorchid1          191    62  255
647
darkorchid2          178    58  238
648
darkorchid2          178    58  238
648
darkorchid3          154    50  205
649
darkorchid3          154    50  205
649
darkorchid4          104    34  139
650
darkorchid4          104    34  139
650
darkred              139     0    0
651
darkred              139     0    0
651
darksalmon           233   150  122
652
darksalmon           233   150  122
652
darkseagreen         143   188  143
653
darkseagreen         143   188  143
653
darkseagreen1        193   255  193
654
darkseagreen1        193   255  193
654
darkseagreen2        180   238  180
655
darkseagreen2        180   238  180
655
darkseagreen3        155   205  155
656
darkseagreen3        155   205  155
656
darkseagreen4        105   139  105
657
darkseagreen4        105   139  105
657
darkslateblue         72    61  139
658
darkslateblue         72    61  139
658
darkslategray         47    79   79
659
darkslategray         47    79   79
659
darkslategray1       151   255  255
660
darkslategray1       151   255  255
660
darkslategray2       141   238  238
661
darkslategray2       141   238  238
661
darkslategray3       121   205  205
662
darkslategray3       121   205  205
662
darkslategray4        82   139  139
663
darkslategray4        82   139  139
663
darkslategrey         47    79   79
664
darkslategrey         47    79   79
664
darkturquoise          0   206  209
665
darkturquoise          0   206  209
665
darkviolet           148     0  211
666
darkviolet           148     0  211
666
deeppink             255    20  147
667
deeppink             255    20  147
667
deeppink1            255    20  147
668
deeppink1            255    20  147
668
deeppink2            238    18  137
669
deeppink2            238    18  137
669
deeppink3            205    16  118
670
deeppink3            205    16  118
670
deeppink4            139    10   80
671
deeppink4            139    10   80
671
deepskyblue            0   191  255
672
deepskyblue            0   191  255
672
deepskyblue1           0   191  255
673
deepskyblue1           0   191  255
673
deepskyblue2           0   178  238
674
deepskyblue2           0   178  238
674
deepskyblue3           0   154  205
675
deepskyblue3           0   154  205
675
deepskyblue4           0   104  139
676
deepskyblue4           0   104  139
676
dimgray              105   105  105
677
dimgray              105   105  105
677
dimgrey              105   105  105
678
dimgrey              105   105  105
678
dodgerblue            30   144  255
679
dodgerblue            30   144  255
679
dodgerblue1           30   144  255
680
dodgerblue1           30   144  255
680
dodgerblue2           28   134  238
681
dodgerblue2           28   134  238
681
dodgerblue3           24   116  205
682
dodgerblue3           24   116  205
682
dodgerblue4           16    78  139
683
dodgerblue4           16    78  139
683
firebrick            178    34   34
684
firebrick            178    34   34
684
firebrick1           255    48   48
685
firebrick1           255    48   48
685
firebrick2           238    44   44
686
firebrick2           238    44   44
686
firebrick3           205    38   38
687
firebrick3           205    38   38
687
firebrick4           139    26   26
688
firebrick4           139    26   26
688
floralwhite          255   250  240
689
floralwhite          255   250  240
689
forestgreen           34   139   34
690
forestgreen           34   139   34
690
gainsboro            220   220  220
691
gainsboro            220   220  220
691
ghostwhite           248   248  255
692
ghostwhite           248   248  255
692
gold                 255   215    0
693
gold                 255   215    0
693
gold1                255   215    0
694
gold1                255   215    0
694
gold2                238   201    0
695
gold2                238   201    0
695
gold3                205   173    0
696
gold3                205   173    0
696
gold4                139   117    0
697
gold4                139   117    0
697
goldenrod            218   165   32
698
goldenrod            218   165   32
698
goldenrod1           255   193   37
699
goldenrod1           255   193   37
699
goldenrod2           238   180   34
700
goldenrod2           238   180   34
700
goldenrod3           205   155   29
701
goldenrod3           205   155   29
701
goldenrod4           139   105   20
702
goldenrod4           139   105   20
702
gray                 190   190  190
703
gray                 190   190  190
703
gray0                  0     0    0
704
gray0                  0     0    0
704
gray1                  3     3    3
705
gray1                  3     3    3
705
gray2                  5     5    5
706
gray2                  5     5    5
706
gray3                  8     8    8
707
gray3                  8     8    8
707
gray4                 10    10   10
708
gray4                 10    10   10
708
gray5                 13    13   13
709
gray5                 13    13   13
709
gray6                 15    15   15
710
gray6                 15    15   15
710
gray7                 18    18   18
711
gray7                 18    18   18
711
gray8                 20    20   20
712
gray8                 20    20   20
712
gray9                 23    23   23
713
gray9                 23    23   23
713
gray10                26    26   26
714
gray10                26    26   26
714
gray11                28    28   28
715
gray11                28    28   28
715
gray12                31    31   31
716
gray12                31    31   31
716
gray13                33    33   33
717
gray13                33    33   33
717
gray14                36    36   36
718
gray14                36    36   36
718
gray15                38    38   38
719
gray15                38    38   38
719
gray16                41    41   41
720
gray16                41    41   41
720
gray17                43    43   43
721
gray17                43    43   43
721
gray18                46    46   46
722
gray18                46    46   46
722
gray19                48    48   48
723
gray19                48    48   48
723
gray20                51    51   51
724
gray20                51    51   51
724
gray21                54    54   54
725
gray21                54    54   54
725
gray22                56    56   56
726
gray22                56    56   56
726
gray23                59    59   59
727
gray23                59    59   59
727
gray24                61    61   61
728
gray24                61    61   61
728
gray25                64    64   64
729
gray25                64    64   64
729
gray26                66    66   66
730
gray26                66    66   66
730
gray27                69    69   69
731
gray27                69    69   69
731
gray28                71    71   71
732
gray28                71    71   71
732
gray29                74    74   74
733
gray29                74    74   74
733
gray30                77    77   77
734
gray30                77    77   77
734
gray31                79    79   79
735
gray31                79    79   79
735
gray32                82    82   82
736
gray32                82    82   82
736
gray33                84    84   84
737
gray33                84    84   84
737
gray34                87    87   87
738
gray34                87    87   87
738
gray35                89    89   89
739
gray35                89    89   89
739
gray36                92    92   92
740
gray36                92    92   92
740
gray37                94    94   94
741
gray37                94    94   94
741
gray38                97    97   97
742
gray38                97    97   97
742
gray39                99    99   99
743
gray39                99    99   99
743
gray40               102   102  102
744
gray40               102   102  102
744
gray41               105   105  105
745
gray41               105   105  105
745
gray42               107   107  107
746
gray42               107   107  107
746
gray43               110   110  110
747
gray43               110   110  110
747
gray44               112   112  112
748
gray44               112   112  112
748
gray45               115   115  115
749
gray45               115   115  115
749
gray46               117   117  117
750
gray46               117   117  117
750
gray47               120   120  120
751
gray47               120   120  120
751
gray48               122   122  122
752
gray48               122   122  122
752
gray49               125   125  125
753
gray49               125   125  125
753
gray50               127   127  127
754
gray50               127   127  127
754
gray51               130   130  130
755
gray51               130   130  130
755
gray52               133   133  133
756
gray52               133   133  133
756
gray53               135   135  135
757
gray53               135   135  135
757
gray54               138   138  138
758
gray54               138   138  138
758
gray55               140   140  140
759
gray55               140   140  140
759
gray56               143   143  143
760
gray56               143   143  143
760
gray57               145   145  145
761
gray57               145   145  145
761
gray58               148   148  148
762
gray58               148   148  148
762
gray59               150   150  150
763
gray59               150   150  150
763
gray60               153   153  153
764
gray60               153   153  153
764
gray61               156   156  156
765
gray61               156   156  156
765
gray62               158   158  158
766
gray62               158   158  158
766
gray63               161   161  161
767
gray63               161   161  161
767
gray64               163   163  163
768
gray64               163   163  163
768
gray65               166   166  166
769
gray65               166   166  166
769
gray66               168   168  168
770
gray66               168   168  168
770
gray67               171   171  171
771
gray67               171   171  171
771
gray68               173   173  173
772
gray68               173   173  173
772
gray69               176   176  176
773
gray69               176   176  176
773
gray70               179   179  179
774
gray70               179   179  179
774
gray71               181   181  181
775
gray71               181   181  181
775
gray72               184   184  184
776
gray72               184   184  184
776
gray73               186   186  186
777
gray73               186   186  186
777
gray74               189   189  189
778
gray74               189   189  189
778
gray75               191   191  191
779
gray75               191   191  191
779
gray76               194   194  194
780
gray76               194   194  194
780
gray77               196   196  196
781
gray77               196   196  196
781
gray78               199   199  199
782
gray78               199   199  199
782
gray79               201   201  201
783
gray79               201   201  201
783
gray80               204   204  204
784
gray80               204   204  204
784
gray81               207   207  207
785
gray81               207   207  207
785
gray82               209   209  209
786
gray82               209   209  209
786
gray83               212   212  212
787
gray83               212   212  212
787
gray84               214   214  214
788
gray84               214   214  214
788
gray85               217   217  217
789
gray85               217   217  217
789
gray86               219   219  219
790
gray86               219   219  219
790
gray87               222   222  222
791
gray87               222   222  222
791
gray88               224   224  224
792
gray88               224   224  224
792
gray89               227   227  227
793
gray89               227   227  227
793
gray90               229   229  229
794
gray90               229   229  229
794
gray91               232   232  232
795
gray91               232   232  232
795
gray92               235   235  235
796
gray92               235   235  235
796
gray93               237   237  237
797
gray93               237   237  237
797
gray94               240   240  240
798
gray94               240   240  240
798
gray95               242   242  242
799
gray95               242   242  242
799
gray96               245   245  245
800
gray96               245   245  245
800
gray97               247   247  247
801
gray97               247   247  247
801
gray98               250   250  250
802
gray98               250   250  250
802
gray99               252   252  252
803
gray99               252   252  252
803
gray100              255   255  255
804
gray100              255   255  255
804
green                  0   255    0
805
green                  0   255    0
805
green1                 0   255    0
806
green1                 0   255    0
806
green2                 0   238    0
807
green2                 0   238    0
807
green3                 0   205    0
808
green3                 0   205    0
808
green4                 0   139    0
809
green4                 0   139    0
809
greenyellow          173   255   47
810
greenyellow          173   255   47
810
grey                 190   190  190
811
grey                 190   190  190
811
grey0                  0     0    0
812
grey0                  0     0    0
812
grey1                  3     3    3
813
grey1                  3     3    3
813
grey2                  5     5    5
814
grey2                  5     5    5
814
grey3                  8     8    8
815
grey3                  8     8    8
815
grey4                 10    10   10
816
grey4                 10    10   10
816
grey5                 13    13   13
817
grey5                 13    13   13
817
grey6                 15    15   15
818
grey6                 15    15   15
818
grey7                 18    18   18
819
grey7                 18    18   18
819
grey8                 20    20   20
820
grey8                 20    20   20
820
grey9                 23    23   23
821
grey9                 23    23   23
821
grey10                26    26   26
822
grey10                26    26   26
822
grey11                28    28   28
823
grey11                28    28   28
823
grey12                31    31   31
824
grey12                31    31   31
824
grey13                33    33   33
825
grey13                33    33   33
825
grey14                36    36   36
826
grey14                36    36   36
826
grey15                38    38   38
827
grey15                38    38   38
827
grey16                41    41   41
828
grey16                41    41   41
828
grey17                43    43   43
829
grey17                43    43   43
829
grey18                46    46   46
830
grey18                46    46   46
830
grey19                48    48   48
831
grey19                48    48   48
831
grey20                51    51   51
832
grey20                51    51   51
832
grey21                54    54   54
833
grey21                54    54   54
833
grey22                56    56   56
834
grey22                56    56   56
834
grey23                59    59   59
835
grey23                59    59   59
835
grey24                61    61   61
836
grey24                61    61   61
836
grey25                64    64   64
837
grey25                64    64   64
837
grey26                66    66   66
838
grey26                66    66   66
838
grey27                69    69   69
839
grey27                69    69   69
839
grey28                71    71   71
840
grey28                71    71   71
840
grey29                74    74   74
841
grey29                74    74   74
841
grey30                77    77   77
842
grey30                77    77   77
842
grey31                79    79   79
843
grey31                79    79   79
843
grey32                82    82   82
844
grey32                82    82   82
844
grey33                84    84   84
845
grey33                84    84   84
845
grey34                87    87   87
846
grey34                87    87   87
846
grey35                89    89   89
847
grey35                89    89   89
847
grey36                92    92   92
848
grey36                92    92   92
848
grey37                94    94   94
849
grey37                94    94   94
849
grey38                97    97   97
850
grey38                97    97   97
850
grey39                99    99   99
851
grey39                99    99   99
851
grey40               102   102  102
852
grey40               102   102  102
852
grey41               105   105  105
853
grey41               105   105  105
853
grey42               107   107  107
854
grey42               107   107  107
854
grey43               110   110  110
855
grey43               110   110  110
855
grey44               112   112  112
856
grey44               112   112  112
856
grey45               115   115  115
857
grey45               115   115  115
857
grey46               117   117  117
858
grey46               117   117  117
858
grey47               120   120  120
859
grey47               120   120  120
859
grey48               122   122  122
860
grey48               122   122  122
860
grey49               125   125  125
861
grey49               125   125  125
861
grey50               127   127  127
862
grey50               127   127  127
862
grey51               130   130  130
863
grey51               130   130  130
863
grey52               133   133  133
864
grey52               133   133  133
864
grey53               135   135  135
865
grey53               135   135  135
865
grey54               138   138  138
866
grey54               138   138  138
866
grey55               140   140  140
867
grey55               140   140  140
867
grey56               143   143  143
868
grey56               143   143  143
868
grey57               145   145  145
869
grey57               145   145  145
869
grey58               148   148  148
870
grey58               148   148  148
870
grey59               150   150  150
871
grey59               150   150  150
871
grey60               153   153  153
872
grey60               153   153  153
872
grey61               156   156  156
873
grey61               156   156  156
873
grey62               158   158  158
874
grey62               158   158  158
874
grey63               161   161  161
875
grey63               161   161  161
875
grey64               163   163  163
876
grey64               163   163  163
876
grey65               166   166  166
877
grey65               166   166  166
877
grey66               168   168  168
878
grey66               168   168  168
878
grey67               171   171  171
879
grey67               171   171  171
879
grey68               173   173  173
880
grey68               173   173  173
880
grey69               176   176  176
881
grey69               176   176  176
881
grey70               179   179  179
882
grey70               179   179  179
882
grey71               181   181  181
883
grey71               181   181  181
883
grey72               184   184  184
884
grey72               184   184  184
884
grey73               186   186  186
885
grey73               186   186  186
885
grey74               189   189  189
886
grey74               189   189  189
886
grey75               191   191  191
887
grey75               191   191  191
887
grey76               194   194  194
888
grey76               194   194  194
888
grey77               196   196  196
889
grey77               196   196  196
889
grey78               199   199  199
890
grey78               199   199  199
890
grey79               201   201  201
891
grey79               201   201  201
891
grey80               204   204  204
892
grey80               204   204  204
892
grey81               207   207  207
893
grey81               207   207  207
893
grey82               209   209  209
894
grey82               209   209  209
894
grey83               212   212  212
895
grey83               212   212  212
895
grey84               214   214  214
896
grey84               214   214  214
896
grey85               217   217  217
897
grey85               217   217  217
897
grey86               219   219  219
898
grey86               219   219  219
898
grey87               222   222  222
899
grey87               222   222  222
899
grey88               224   224  224
900
grey88               224   224  224
900
grey89               227   227  227
901
grey89               227   227  227
901
grey90               229   229  229
902
grey90               229   229  229
902
grey91               232   232  232
903
grey91               232   232  232
903
grey92               235   235  235
904
grey92               235   235  235
904
grey93               237   237  237
905
grey93               237   237  237
905
grey94               240   240  240
906
grey94               240   240  240
906
grey95               242   242  242
907
grey95               242   242  242
907
grey96               245   245  245
908
grey96               245   245  245
908
grey97               247   247  247
909
grey97               247   247  247
909
grey98               250   250  250
910
grey98               250   250  250
910
grey99               252   252  252
911
grey99               252   252  252
911
grey100              255   255  255
912
grey100              255   255  255
912
honeydew             240   255  240
913
honeydew             240   255  240
913
honeydew1            240   255  240
914
honeydew1            240   255  240
914
honeydew2            224   238  224
915
honeydew2            224   238  224
915
honeydew3            193   205  193
916
honeydew3            193   205  193
916
honeydew4            131   139  131
917
honeydew4            131   139  131
917
hotpink              255   105  180
918
hotpink              255   105  180
918
hotpink1             255   110  180
919
hotpink1             255   110  180
919
hotpink2             238   106  167
920
hotpink2             238   106  167
920
hotpink3             205    96  144
921
hotpink3             205    96  144
921
hotpink4             139    58   98
922
hotpink4             139    58   98
922
indianred            205    92   92
923
indianred            205    92   92
923
indianred1           255   106  106
924
indianred1           255   106  106
924
indianred2           238    99   99
925
indianred2           238    99   99
925
indianred3           205    85   85
926
indianred3           205    85   85
926
indianred4           139    58   58
927
indianred4           139    58   58
927
ivory                255   255  240
928
ivory                255   255  240
928
ivory1               255   255  240
929
ivory1               255   255  240
929
ivory2               238   238  224
930
ivory2               238   238  224
930
ivory3               205   205  193
931
ivory3               205   205  193
931
ivory4               139   139  131
932
ivory4               139   139  131
932
khaki                240   230  140
933
khaki                240   230  140
933
khaki1               255   246  143
934
khaki1               255   246  143
934
khaki2               238   230  133
935
khaki2               238   230  133
935
khaki3               205   198  115
936
khaki3               205   198  115
936
khaki4               139   134   78
937
khaki4               139   134   78
937
lavender             230   230  250
938
lavender             230   230  250
938
lavenderblush        255   240  245
939
lavenderblush        255   240  245
939
lavenderblush1       255   240  245
940
lavenderblush1       255   240  245
940
lavenderblush2       238   224  229
941
lavenderblush2       238   224  229
941
lavenderblush3       205   193  197
942
lavenderblush3       205   193  197
942
lavenderblush4       139   131  134
943
lavenderblush4       139   131  134
943
lawngreen            124   252    0
944
lawngreen            124   252    0
944
lemonchiffon         255   250  205
945
lemonchiffon         255   250  205
945
lemonchiffon1        255   250  205
946
lemonchiffon1        255   250  205
946
lemonchiffon2        238   233  191
947
lemonchiffon2        238   233  191
947
lemonchiffon3        205   201  165
948
lemonchiffon3        205   201  165
948
lemonchiffon4        139   137  112
949
lemonchiffon4        139   137  112
949
lightblue            173   216  230
950
lightblue            173   216  230
950
lightblue1           191   239  255
951
lightblue1           191   239  255
951
lightblue2           178   223  238
952
lightblue2           178   223  238
952
lightblue3           154   192  205
953
lightblue3           154   192  205
953
lightblue4           104   131  139
954
lightblue4           104   131  139
954
lightcoral           240   128  128
955
lightcoral           240   128  128
955
lightcyan            224   255  255
956
lightcyan            224   255  255
956
lightcyan1           224   255  255
957
lightcyan1           224   255  255
957
lightcyan2           209   238  238
958
lightcyan2           209   238  238
958
lightcyan3           180   205  205
959
lightcyan3           180   205  205
959
lightcyan4           122   139  139
960
lightcyan4           122   139  139
960
lightgoldenrod       238   221  130
961
lightgoldenrod       238   221  130
961
lightgoldenrod1      255   236  139
962
lightgoldenrod1      255   236  139
962
lightgoldenrod2      238   220  130
963
lightgoldenrod2      238   220  130
963
lightgoldenrod3      205   190  112
964
lightgoldenrod3      205   190  112
964
lightgoldenrod4      139   129   76
965
lightgoldenrod4      139   129   76
965
lightgoldenrodyellow 250   250  210
966
lightgoldenrodyellow 250   250  210
966
lightgray            211   211  211
967
lightgray            211   211  211
967
lightgreen           144   238  144
968
lightgreen           144   238  144
968
lightgrey            211   211  211
969
lightgrey            211   211  211
969
lightpink            255   182  193
970
lightpink            255   182  193
970
lightpink1           255   174  185
971
lightpink1           255   174  185
971
lightpink2           238   162  173
972
lightpink2           238   162  173
972
lightpink3           205   140  149
973
lightpink3           205   140  149
973
lightpink4           139    95  101
974
lightpink4           139    95  101
974
lightsalmon          255   160  122
975
lightsalmon          255   160  122
975
lightsalmon1         255   160  122
976
lightsalmon1         255   160  122
976
lightsalmon2         238   149  114
977
lightsalmon2         238   149  114
977
lightsalmon3         205   129   98
978
lightsalmon3         205   129   98
978
lightsalmon4         139    87   66
979
lightsalmon4         139    87   66
979
lightseagreen         32   178  170
980
lightseagreen         32   178  170
980
lightskyblue         135   206  250
981
lightskyblue         135   206  250
981
lightskyblue1        176   226  255
982
lightskyblue1        176   226  255
982
lightskyblue2        164   211  238
983
lightskyblue2        164   211  238
983
lightskyblue3        141   182  205
984
lightskyblue3        141   182  205
984
lightskyblue4         96   123  139
985
lightskyblue4         96   123  139
985
lightslateblue       132   112  255
986
lightslateblue       132   112  255
986
lightslategray       119   136  153
987
lightslategray       119   136  153
987
lightslategrey       119   136  153
988
lightslategrey       119   136  153
988
lightsteelblue       176   196  222
989
lightsteelblue       176   196  222
989
lightsteelblue1      202   225  255
990
lightsteelblue1      202   225  255
990
lightsteelblue2      188   210  238
991
lightsteelblue2      188   210  238
991
lightsteelblue3      162   181  205
992
lightsteelblue3      162   181  205
992
lightsteelblue4      110   123  139
993
lightsteelblue4      110   123  139
993
lightyellow          255   255  224
994
lightyellow          255   255  224
994
lightyellow1         255   255  224
995
lightyellow1         255   255  224
995
lightyellow2         238   238  209
996
lightyellow2         238   238  209
996
lightyellow3         205   205  180
997
lightyellow3         205   205  180
997
lightyellow4         139   139  122
998
lightyellow4         139   139  122
998
limegreen             50   205   50
999
limegreen             50   205   50
999
linen                250   240  230
1000
linen                250   240  230
1000
magenta              255     0  255
1001
magenta              255     0  255
1001
magenta1             255     0  255
1002
magenta1             255     0  255
1002
magenta2             238     0  238
1003
magenta2             238     0  238
1003
magenta3             205     0  205
1004
magenta3             205     0  205
1004
magenta4             139     0  139
1005
magenta4             139     0  139
1005
maroon               176    48   96
1006
maroon               176    48   96
1006
maroon1              255    52  179
1007
maroon1              255    52  179
1007
maroon2              238    48  167
1008
maroon2              238    48  167
1008
maroon3              205    41  144
1009
maroon3              205    41  144
1009
maroon4              139    28   98
1010
maroon4              139    28   98
1010
mediumaquamarine     102   205  170
1011
mediumaquamarine     102   205  170
1011
mediumblue             0     0  205
1012
mediumblue             0     0  205
1012
mediumorchid         186    85  211
1013
mediumorchid         186    85  211
1013
mediumorchid1        224   102  255
1014
mediumorchid1        224   102  255
1014
mediumorchid2        209    95  238
1015
mediumorchid2        209    95  238
1015
mediumorchid3        180    82  205
1016
mediumorchid3        180    82  205
1016
mediumorchid4        122    55  139
1017
mediumorchid4        122    55  139
1017
mediumpurple         147   112  219
1018
mediumpurple         147   112  219
1018
mediumpurple1        171   130  255
1019
mediumpurple1        171   130  255
1019
mediumpurple2        159   121  238
1020
mediumpurple2        159   121  238
1020
mediumpurple3        137   104  205
1021
mediumpurple3        137   104  205
1021
mediumpurple4         93    71  139
1022
mediumpurple4         93    71  139
1022
mediumseagreen        60   179  113
1023
mediumseagreen        60   179  113
1023
mediumslateblue      123   104  238
1024
mediumslateblue      123   104  238
1024
mediumspringgreen      0   250  154
1025
mediumspringgreen      0   250  154
1025
mediumturquoise       72   209  204
1026
mediumturquoise       72   209  204
1026
mediumvioletred      199    21  133
1027
mediumvioletred      199    21  133
1027
midnightblue          25    25  112
1028
midnightblue          25    25  112
1028
mintcream            245   255  250
1029
mintcream            245   255  250
1029
mistyrose            255   228  225
1030
mistyrose            255   228  225
1030
mistyrose1           255   228  225
1031
mistyrose1           255   228  225
1031
mistyrose2           238   213  210
1032
mistyrose2           238   213  210
1032
mistyrose3           205   183  181
1033
mistyrose3           205   183  181
1033
mistyrose4           139   125  123
1034
mistyrose4           139   125  123
1034
moccasin             255   228  181
1035
moccasin             255   228  181
1035
navajowhite          255   222  173
1036
navajowhite          255   222  173
1036
navajowhite1         255   222  173
1037
navajowhite1         255   222  173
1037
navajowhite2         238   207  161
1038
navajowhite2         238   207  161
1038
navajowhite3         205   179  139
1039
navajowhite3         205   179  139
1039
navajowhite4         139   121   94
1040
navajowhite4         139   121   94
1040
navy                   0     0  128
1041
navy                   0     0  128
1041
navyblue               0     0  128
1042
navyblue               0     0  128
1042
oldlace              253   245  230
1043
oldlace              253   245  230
1043
olivedrab            107   142   35
1044
olivedrab            107   142   35
1044
olivedrab1           192   255   62
1045
olivedrab1           192   255   62
1045
olivedrab2           179   238   58
1046
olivedrab2           179   238   58
1046
olivedrab3           154   205   50
1047
olivedrab3           154   205   50
1047
olivedrab4           105   139   34
1048
olivedrab4           105   139   34
1048
orange               255   165    0
1049
orange               255   165    0
1049
orange1              255   165    0
1050
orange1              255   165    0
1050
orange2              238   154    0
1051
orange2              238   154    0
1051
orange3              205   133    0
1052
orange3              205   133    0
1052
orange4              139    90    0
1053
orange4              139    90    0
1053
orangered            255    69    0
1054
orangered            255    69    0
1054
orangered1           255    69    0
1055
orangered1           255    69    0
1055
orangered2           238    64    0
1056
orangered2           238    64    0
1056
orangered3           205    55    0
1057
orangered3           205    55    0
1057
orangered4           139    37    0
1058
orangered4           139    37    0
1058
orchid               218   112  214
1059
orchid               218   112  214
1059
orchid1              255   131  250
1060
orchid1              255   131  250
1060
orchid2              238   122  233
1061
orchid2              238   122  233
1061
orchid3              205   105  201
1062
orchid3              205   105  201
1062
orchid4              139    71  137
1063
orchid4              139    71  137
1063
palegoldenrod        238   232  170
1064
palegoldenrod        238   232  170
1064
palegreen            152   251  152
1065
palegreen            152   251  152
1065
palegreen1           154   255  154
1066
palegreen1           154   255  154
1066
palegreen2           144   238  144
1067
palegreen2           144   238  144
1067
palegreen3           124   205  124
1068
palegreen3           124   205  124
1068
palegreen4            84   139   84
1069
palegreen4            84   139   84
1069
paleturquoise        175   238  238
1070
paleturquoise        175   238  238
1070
paleturquoise1       187   255  255
1071
paleturquoise1       187   255  255
1071
paleturquoise2       174   238  238
1072
paleturquoise2       174   238  238
1072
paleturquoise3       150   205  205
1073
paleturquoise3       150   205  205
1073
paleturquoise4       102   139  139
1074
paleturquoise4       102   139  139
1074
palevioletred        219   112  147
1075
palevioletred        219   112  147
1075
palevioletred1       255   130  171
1076
palevioletred1       255   130  171
1076
palevioletred2       238   121  159
1077
palevioletred2       238   121  159
1077
palevioletred3       205   104  137
1078
palevioletred3       205   104  137
1078
palevioletred4       139    71   93
1079
palevioletred4       139    71   93
1079
papayawhip           255   239  213
1080
papayawhip           255   239  213
1080
peachpuff            255   218  185
1081
peachpuff            255   218  185
1081
peachpuff1           255   218  185
1082
peachpuff1           255   218  185
1082
peachpuff2           238   203  173
1083
peachpuff2           238   203  173
1083
peachpuff3           205   175  149
1084
peachpuff3           205   175  149
1084
peachpuff4           139   119  101
1085
peachpuff4           139   119  101
1085
peru                 205   133   63
1086
peru                 205   133   63
1086
pink                 255   192  203
1087
pink                 255   192  203
1087
pink1                255   181  197
1088
pink1                255   181  197
1088
pink2                238   169  184
1089
pink2                238   169  184
1089
pink3                205   145  158
1090
pink3                205   145  158
1090
pink4                139    99  108
1091
pink4                139    99  108
1091
plum                 221   160  221
1092
plum                 221   160  221
1092
plum1                255   187  255
1093
plum1                255   187  255
1093
plum2                238   174  238
1094
plum2                238   174  238
1094
plum3                205   150  205
1095
plum3                205   150  205
1095
plum4                139   102  139
1096
plum4                139   102  139
1096
powderblue           176   224  230
1097
powderblue           176   224  230
1097
purple               160    32  240
1098
purple               160    32  240
1098
purple1              155    48  255
1099
purple1              155    48  255
1099
purple2              145    44  238
1100
purple2              145    44  238
1100
purple3              125    38  205
1101
purple3              125    38  205
1101
purple4               85    26  139
1102
purple4               85    26  139
1102
red                  255     0    0
1103
red                  255     0    0
1103
red1                 255     0    0
1104
red1                 255     0    0
1104
red2                 238     0    0
1105
red2                 238     0    0
1105
red3                 205     0    0
1106
red3                 205     0    0
1106
red4                 139     0    0
1107
red4                 139     0    0
1107
rosybrown            188   143  143
1108
rosybrown            188   143  143
1108
rosybrown1           255   193  193
1109
rosybrown1           255   193  193
1109
rosybrown2           238   180  180
1110
rosybrown2           238   180  180
1110
rosybrown3           205   155  155
1111
rosybrown3           205   155  155
1111
rosybrown4           139   105  105
1112
rosybrown4           139   105  105
1112
royalblue             65   105  225
1113
royalblue             65   105  225
1113
royalblue1            72   118  255
1114
royalblue1            72   118  255
1114
royalblue2            67   110  238
1115
royalblue2            67   110  238
1115
royalblue3            58    95  205
1116
royalblue3            58    95  205
1116
royalblue4            39    64  139
1117
royalblue4            39    64  139
1117
saddlebrown          139    69   19
1118
saddlebrown          139    69   19
1118
salmon               250   128  114
1119
salmon               250   128  114
1119
salmon1              255   140  105
1120
salmon1              255   140  105
1120
salmon2              238   130   98
1121
salmon2              238   130   98
1121
salmon3              205   112   84
1122
salmon3              205   112   84
1122
salmon4              139    76   57
1123
salmon4              139    76   57
1123
sandybrown           244   164   96
1124
sandybrown           244   164   96
1124
seagreen              46   139   87
1125
seagreen              46   139   87
1125
seagreen1             84   255  159
1126
seagreen1             84   255  159
1126
seagreen2             78   238  148
1127
seagreen2             78   238  148
1127
seagreen3             67   205  128
1128
seagreen3             67   205  128
1128
seagreen4             46   139   87
1129
seagreen4             46   139   87
1129
seashell             255   245  238
1130
seashell             255   245  238
1130
seashell1            255   245  238
1131
seashell1            255   245  238
1131
seashell2            238   229  222
1132
seashell2            238   229  222
1132
seashell3            205   197  191
1133
seashell3            205   197  191
1133
seashell4            139   134  130
1134
seashell4            139   134  130
1134
sienna               160    82   45
1135
sienna               160    82   45
1135
sienna1              255   130   71
1136
sienna1              255   130   71
1136
sienna2              238   121   66
1137
sienna2              238   121   66
1137
sienna3              205   104   57
1138
sienna3              205   104   57
1138
sienna4              139    71   38
1139
sienna4              139    71   38
1139
skyblue              135   206  235
1140
skyblue              135   206  235
1140
skyblue1             135   206  255
1141
skyblue1             135   206  255
1141
skyblue2             126   192  238
1142
skyblue2             126   192  238
1142
skyblue3             108   166  205
1143
skyblue3             108   166  205
1143
skyblue4              74   112  139
1144
skyblue4              74   112  139
1144
slateblue            106    90  205
1145
slateblue            106    90  205
1145
slateblue1           131   111  255
1146
slateblue1           131   111  255
1146
slateblue2           122   103  238
1147
slateblue2           122   103  238
1147
slateblue3           105    89  205
1148
slateblue3           105    89  205
1148
slateblue4            71    60  139
1149
slateblue4            71    60  139
1149
slategray            112   128  144
1150
slategray            112   128  144
1150
slategray1           198   226  255
1151
slategray1           198   226  255
1151
slategray2           185   211  238
1152
slategray2           185   211  238
1152
slategray3           159   182  205
1153
slategray3           159   182  205
1153
slategray4           108   123  139
1154
slategray4           108   123  139
1154
slategrey            112   128  144
1155
slategrey            112   128  144
1155
snow                 255   250  250
1156
snow                 255   250  250
1156
snow1                255   250  250
1157
snow1                255   250  250
1157
snow2                238   233  233
1158
snow2                238   233  233
1158
snow3                205   201  201
1159
snow3                205   201  201
1159
snow4                139   137  137
1160
snow4                139   137  137
1160
springgreen            0   255  127
1161
springgreen            0   255  127
1161
springgreen1           0   255  127
1162
springgreen1           0   255  127
1162
springgreen2           0   238  118
1163
springgreen2           0   238  118
1163
springgreen3           0   205  102
1164
springgreen3           0   205  102
1164
springgreen4           0   139   69
1165
springgreen4           0   139   69
1165
steelblue             70   130  180
1166
steelblue             70   130  180
1166
steelblue1            99   184  255
1167
steelblue1            99   184  255
1167
steelblue2            92   172  238
1168
steelblue2            92   172  238
1168
steelblue3            79   148  205
1169
steelblue3            79   148  205
1169
steelblue4            54   100  139
1170
steelblue4            54   100  139
1170
tan                  210   180  140
1171
tan                  210   180  140
1171
tan1                 255   165   79
1172
tan1                 255   165   79
1172
tan2                 238   154   73
1173
tan2                 238   154   73
1173
tan3                 205   133   63
1174
tan3                 205   133   63
1174
tan4                 139    90   43
1175
tan4                 139    90   43
1175
thistle              216   191  216
1176
thistle              216   191  216
1176
thistle1             255   225  255
1177
thistle1             255   225  255
1177
thistle2             238   210  238
1178
thistle2             238   210  238
1178
thistle3             205   181  205
1179
thistle3             205   181  205
1179
thistle4             139   123  139
1180
thistle4             139   123  139
1180
tomato               255    99   71
1181
tomato               255    99   71
1181
tomato1              255    99   71
1182
tomato1              255    99   71
1182
tomato2              238    92   66
1183
tomato2              238    92   66
1183
tomato3              205    79   57
1184
tomato3              205    79   57
1184
tomato4              139    54   38
1185
tomato4              139    54   38
1185
turquoise             64   224  208
1186
turquoise             64   224  208
1186
turquoise1             0   245  255
1187
turquoise1             0   245  255
1187
turquoise2             0   229  238
1188
turquoise2             0   229  238
1188
turquoise3             0   197  205
1189
turquoise3             0   197  205
1189
turquoise4             0   134  139
1190
turquoise4             0   134  139
1190
violet               238   130  238
1191
violet               238   130  238
1191
violetred            208    32  144
1192
violetred            208    32  144
1192
violetred1           255    62  150
1193
violetred1           255    62  150
1193
violetred2           238    58  140
1194
violetred2           238    58  140
1194
violetred3           205    50  120
1195
violetred3           205    50  120
1195
violetred4           139    34   82
1196
violetred4           139    34   82
1196
wheat                245   222  179
1197
wheat                245   222  179
1197
wheat1               255   231  186
1198
wheat1               255   231  186
1198
wheat2               238   216  174
1199
wheat2               238   216  174
1199
wheat3               205   186  150
1200
wheat3               205   186  150
1200
wheat4               139   126  102
1201
wheat4               139   126  102
1201
whitesmoke           245   245  245
1202
whitesmoke           245   245  245
1202
yellow               255   255    0
1203
yellow               255   255    0
1203
yellow1              255   255    0
1204
yellow1              255   255    0
1204
yellow2              238   238    0
1205
yellow2              238   238    0
1205
yellow3              205   205    0
1206
yellow3              205   205    0
1206
yellow4              139   139    0
1207
yellow4              139   139    0
1207
yellowgreen          154   205   50
1208
yellowgreen          154   205   50
1208
> 
1209
> 
1209
> ccodes <- c(256^(2:0) %*% crgb)## = internal codes
1210
> ccodes <- c(256^(2:0) %*% crgb)## = internal codes
1210
> ## How many names are 'aliases' of each other:
1211
> ## How many names are 'aliases' of each other:
1211
> table(tcc <- table(ccodes))
1212
> table(tcc <- table(ccodes))
1212
 
1213
 
1213
  1   2   3   4 
1214
  1   2   3   4 
1214
352 146   3   1 
1215
352 146   3   1 
1215
> length(uc <- unique(sort(ccodes))) # 502
1216
> length(uc <- unique(sort(ccodes))) # 502
1216
[1] 502
1217
[1] 502
1217
> ## All the multiply named colors:
1218
> ## All the multiply named colors:
1218
> mult <- uc[tcc >= 2]
1219
> mult <- uc[tcc >= 2]
1219
> cl <- lapply(mult, function(m) cc[ccodes == m])
1220
> cl <- lapply(mult, function(m) cc[ccodes == m])
1220
> names(cl) <- apply(col2rgb(sapply(cl, function(x)x[1])),
1221
> names(cl) <- apply(col2rgb(sapply(cl, function(x)x[1])),
1221
+                    2, function(n)paste(n, collapse=","))
1222
+                    2, function(n)paste(n, collapse=","))
1222
> utils::str(cl)
1223
> utils::str(cl)
1223
List of 150
1224
List of 150
1224
 $ 0,0,0      : chr [1:3] "black" "gray0" "grey0"
1225
 $ 0,0,0      : chr [1:3] "black" "gray0" "grey0"
1225
 $ 0,0,128    : chr [1:2] "navy" "navyblue"
1226
 $ 0,0,128    : chr [1:2] "navy" "navyblue"
1226
 $ 0,0,139    : chr [1:2] "blue4" "darkblue"
1227
 $ 0,0,139    : chr [1:2] "blue4" "darkblue"
1227
 $ 0,0,205    : chr [1:2] "blue3" "mediumblue"
1228
 $ 0,0,205    : chr [1:2] "blue3" "mediumblue"
1228
 $ 0,0,255    : chr [1:2] "blue" "blue1"
1229
 $ 0,0,255    : chr [1:2] "blue" "blue1"
1229
 $ 0,139,139  : chr [1:2] "cyan4" "darkcyan"
1230
 $ 0,139,139  : chr [1:2] "cyan4" "darkcyan"
1230
 $ 0,191,255  : chr [1:2] "deepskyblue" "deepskyblue1"
1231
 $ 0,191,255  : chr [1:2] "deepskyblue" "deepskyblue1"
1231
 $ 0,255,0    : chr [1:2] "green" "green1"
1232
 $ 0,255,0    : chr [1:2] "green" "green1"
1232
 $ 0,255,127  : chr [1:2] "springgreen" "springgreen1"
1233
 $ 0,255,127  : chr [1:2] "springgreen" "springgreen1"
1233
 $ 0,255,255  : chr [1:2] "cyan" "cyan1"
1234
 $ 0,255,255  : chr [1:2] "cyan" "cyan1"
1234
 $ 3,3,3      : chr [1:2] "gray1" "grey1"
1235
 $ 3,3,3      : chr [1:2] "gray1" "grey1"
1235
 $ 5,5,5      : chr [1:2] "gray2" "grey2"
1236
 $ 5,5,5      : chr [1:2] "gray2" "grey2"
1236
 $ 8,8,8      : chr [1:2] "gray3" "grey3"
1237
 $ 8,8,8      : chr [1:2] "gray3" "grey3"
1237
 $ 10,10,10   : chr [1:2] "gray4" "grey4"
1238
 $ 10,10,10   : chr [1:2] "gray4" "grey4"
1238
 $ 13,13,13   : chr [1:2] "gray5" "grey5"
1239
 $ 13,13,13   : chr [1:2] "gray5" "grey5"
1239
 $ 15,15,15   : chr [1:2] "gray6" "grey6"
1240
 $ 15,15,15   : chr [1:2] "gray6" "grey6"
1240
 $ 18,18,18   : chr [1:2] "gray7" "grey7"
1241
 $ 18,18,18   : chr [1:2] "gray7" "grey7"
1241
 $ 20,20,20   : chr [1:2] "gray8" "grey8"
1242
 $ 20,20,20   : chr [1:2] "gray8" "grey8"
1242
 $ 23,23,23   : chr [1:2] "gray9" "grey9"
1243
 $ 23,23,23   : chr [1:2] "gray9" "grey9"
1243
 $ 26,26,26   : chr [1:2] "gray10" "grey10"
1244
 $ 26,26,26   : chr [1:2] "gray10" "grey10"
1244
 $ 28,28,28   : chr [1:2] "gray11" "grey11"
1245
 $ 28,28,28   : chr [1:2] "gray11" "grey11"
1245
 $ 30,144,255 : chr [1:2] "dodgerblue" "dodgerblue1"
1246
 $ 30,144,255 : chr [1:2] "dodgerblue" "dodgerblue1"
1246
 $ 31,31,31   : chr [1:2] "gray12" "grey12"
1247
 $ 31,31,31   : chr [1:2] "gray12" "grey12"
1247
 $ 33,33,33   : chr [1:2] "gray13" "grey13"
1248
 $ 33,33,33   : chr [1:2] "gray13" "grey13"
1248
 $ 36,36,36   : chr [1:2] "gray14" "grey14"
1249
 $ 36,36,36   : chr [1:2] "gray14" "grey14"
1249
 $ 38,38,38   : chr [1:2] "gray15" "grey15"
1250
 $ 38,38,38   : chr [1:2] "gray15" "grey15"
1250
 $ 41,41,41   : chr [1:2] "gray16" "grey16"
1251
 $ 41,41,41   : chr [1:2] "gray16" "grey16"
1251
 $ 43,43,43   : chr [1:2] "gray17" "grey17"
1252
 $ 43,43,43   : chr [1:2] "gray17" "grey17"
1252
 $ 46,46,46   : chr [1:2] "gray18" "grey18"
1253
 $ 46,46,46   : chr [1:2] "gray18" "grey18"
1253
 $ 46,139,87  : chr [1:2] "seagreen" "seagreen4"
1254
 $ 46,139,87  : chr [1:2] "seagreen" "seagreen4"
1254
 $ 47,79,79   : chr [1:2] "darkslategray" "darkslategrey"
1255
 $ 47,79,79   : chr [1:2] "darkslategray" "darkslategrey"
1255
 $ 48,48,48   : chr [1:2] "gray19" "grey19"
1256
 $ 48,48,48   : chr [1:2] "gray19" "grey19"
1256
 $ 51,51,51   : chr [1:2] "gray20" "grey20"
1257
 $ 51,51,51   : chr [1:2] "gray20" "grey20"
1257
 $ 54,54,54   : chr [1:2] "gray21" "grey21"
1258
 $ 54,54,54   : chr [1:2] "gray21" "grey21"
1258
 $ 56,56,56   : chr [1:2] "gray22" "grey22"
1259
 $ 56,56,56   : chr [1:2] "gray22" "grey22"
1259
 $ 59,59,59   : chr [1:2] "gray23" "grey23"
1260
 $ 59,59,59   : chr [1:2] "gray23" "grey23"
1260
 $ 61,61,61   : chr [1:2] "gray24" "grey24"
1261
 $ 61,61,61   : chr [1:2] "gray24" "grey24"
1261
 $ 64,64,64   : chr [1:2] "gray25" "grey25"
1262
 $ 64,64,64   : chr [1:2] "gray25" "grey25"
1262
 $ 66,66,66   : chr [1:2] "gray26" "grey26"
1263
 $ 66,66,66   : chr [1:2] "gray26" "grey26"
1263
 $ 69,69,69   : chr [1:2] "gray27" "grey27"
1264
 $ 69,69,69   : chr [1:2] "gray27" "grey27"
1264
 $ 71,71,71   : chr [1:2] "gray28" "grey28"
1265
 $ 71,71,71   : chr [1:2] "gray28" "grey28"
1265
 $ 74,74,74   : chr [1:2] "gray29" "grey29"
1266
 $ 74,74,74   : chr [1:2] "gray29" "grey29"
1266
 $ 77,77,77   : chr [1:2] "gray30" "grey30"
1267
 $ 77,77,77   : chr [1:2] "gray30" "grey30"
1267
 $ 79,79,79   : chr [1:2] "gray31" "grey31"
1268
 $ 79,79,79   : chr [1:2] "gray31" "grey31"
1268
 $ 82,82,82   : chr [1:2] "gray32" "grey32"
1269
 $ 82,82,82   : chr [1:2] "gray32" "grey32"
1269
 $ 84,84,84   : chr [1:2] "gray33" "grey33"
1270
 $ 84,84,84   : chr [1:2] "gray33" "grey33"
1270
 $ 87,87,87   : chr [1:2] "gray34" "grey34"
1271
 $ 87,87,87   : chr [1:2] "gray34" "grey34"
1271
 $ 89,89,89   : chr [1:2] "gray35" "grey35"
1272
 $ 89,89,89   : chr [1:2] "gray35" "grey35"
1272
 $ 92,92,92   : chr [1:2] "gray36" "grey36"
1273
 $ 92,92,92   : chr [1:2] "gray36" "grey36"
1273
 $ 94,94,94   : chr [1:2] "gray37" "grey37"
1274
 $ 94,94,94   : chr [1:2] "gray37" "grey37"
1274
 $ 97,97,97   : chr [1:2] "gray38" "grey38"
1275
 $ 97,97,97   : chr [1:2] "gray38" "grey38"
1275
 $ 99,99,99   : chr [1:2] "gray39" "grey39"
1276
 $ 99,99,99   : chr [1:2] "gray39" "grey39"
1276
 $ 102,102,102: chr [1:2] "gray40" "grey40"
1277
 $ 102,102,102: chr [1:2] "gray40" "grey40"
1277
 $ 102,205,170: chr [1:2] "aquamarine3" "mediumaquamarine"
1278
 $ 102,205,170: chr [1:2] "aquamarine3" "mediumaquamarine"
1278
 $ 105,105,105: chr [1:4] "dimgray" "dimgrey" "gray41" "grey41"
1279
 $ 105,105,105: chr [1:4] "dimgray" "dimgrey" "gray41" "grey41"
1279
 $ 107,107,107: chr [1:2] "gray42" "grey42"
1280
 $ 107,107,107: chr [1:2] "gray42" "grey42"
1280
 $ 110,110,110: chr [1:2] "gray43" "grey43"
1281
 $ 110,110,110: chr [1:2] "gray43" "grey43"
1281
 $ 112,112,112: chr [1:2] "gray44" "grey44"
1282
 $ 112,112,112: chr [1:2] "gray44" "grey44"
1282
 $ 112,128,144: chr [1:2] "slategray" "slategrey"
1283
 $ 112,128,144: chr [1:2] "slategray" "slategrey"
1283
 $ 115,115,115: chr [1:2] "gray45" "grey45"
1284
 $ 115,115,115: chr [1:2] "gray45" "grey45"
1284
 $ 117,117,117: chr [1:2] "gray46" "grey46"
1285
 $ 117,117,117: chr [1:2] "gray46" "grey46"
1285
 $ 119,136,153: chr [1:2] "lightslategray" "lightslategrey"
1286
 $ 119,136,153: chr [1:2] "lightslategray" "lightslategrey"
1286
 $ 120,120,120: chr [1:2] "gray47" "grey47"
1287
 $ 120,120,120: chr [1:2] "gray47" "grey47"
1287
 $ 122,122,122: chr [1:2] "gray48" "grey48"
1288
 $ 122,122,122: chr [1:2] "gray48" "grey48"
1288
 $ 125,125,125: chr [1:2] "gray49" "grey49"
1289
 $ 125,125,125: chr [1:2] "gray49" "grey49"
1289
 $ 127,127,127: chr [1:2] "gray50" "grey50"
1290
 $ 127,127,127: chr [1:2] "gray50" "grey50"
1290
 $ 127,255,0  : chr [1:2] "chartreuse" "chartreuse1"
1291
 $ 127,255,0  : chr [1:2] "chartreuse" "chartreuse1"
1291
 $ 127,255,212: chr [1:2] "aquamarine" "aquamarine1"
1292
 $ 127,255,212: chr [1:2] "aquamarine" "aquamarine1"
1292
 $ 130,130,130: chr [1:2] "gray51" "grey51"
1293
 $ 130,130,130: chr [1:2] "gray51" "grey51"
1293
 $ 133,133,133: chr [1:2] "gray52" "grey52"
1294
 $ 133,133,133: chr [1:2] "gray52" "grey52"
1294
 $ 135,135,135: chr [1:2] "gray53" "grey53"
1295
 $ 135,135,135: chr [1:2] "gray53" "grey53"
1295
 $ 138,138,138: chr [1:2] "gray54" "grey54"
1296
 $ 138,138,138: chr [1:2] "gray54" "grey54"
1296
 $ 139,0,0    : chr [1:2] "darkred" "red4"
1297
 $ 139,0,0    : chr [1:2] "darkred" "red4"
1297
 $ 139,0,139  : chr [1:2] "darkmagenta" "magenta4"
1298
 $ 139,0,139  : chr [1:2] "darkmagenta" "magenta4"
1298
 $ 139,69,19  : chr [1:2] "chocolate4" "saddlebrown"
1299
 $ 139,69,19  : chr [1:2] "chocolate4" "saddlebrown"
1299
 $ 140,140,140: chr [1:2] "gray55" "grey55"
1300
 $ 140,140,140: chr [1:2] "gray55" "grey55"
1300
 $ 143,143,143: chr [1:2] "gray56" "grey56"
1301
 $ 143,143,143: chr [1:2] "gray56" "grey56"
1301
 $ 144,238,144: chr [1:2] "lightgreen" "palegreen2"
1302
 $ 144,238,144: chr [1:2] "lightgreen" "palegreen2"
1302
 $ 145,145,145: chr [1:2] "gray57" "grey57"
1303
 $ 145,145,145: chr [1:2] "gray57" "grey57"
1303
 $ 148,148,148: chr [1:2] "gray58" "grey58"
1304
 $ 148,148,148: chr [1:2] "gray58" "grey58"
1304
 $ 150,150,150: chr [1:2] "gray59" "grey59"
1305
 $ 150,150,150: chr [1:2] "gray59" "grey59"
1305
 $ 153,153,153: chr [1:2] "gray60" "grey60"
1306
 $ 153,153,153: chr [1:2] "gray60" "grey60"
1306
 $ 154,205,50 : chr [1:2] "olivedrab3" "yellowgreen"
1307
 $ 154,205,50 : chr [1:2] "olivedrab3" "yellowgreen"
1307
 $ 156,156,156: chr [1:2] "gray61" "grey61"
1308
 $ 156,156,156: chr [1:2] "gray61" "grey61"
1308
 $ 158,158,158: chr [1:2] "gray62" "grey62"
1309
 $ 158,158,158: chr [1:2] "gray62" "grey62"
1309
 $ 161,161,161: chr [1:2] "gray63" "grey63"
1310
 $ 161,161,161: chr [1:2] "gray63" "grey63"
1310
 $ 163,163,163: chr [1:2] "gray64" "grey64"
1311
 $ 163,163,163: chr [1:2] "gray64" "grey64"
1311
 $ 166,166,166: chr [1:2] "gray65" "grey65"
1312
 $ 166,166,166: chr [1:2] "gray65" "grey65"
1312
 $ 168,168,168: chr [1:2] "gray66" "grey66"
1313
 $ 168,168,168: chr [1:2] "gray66" "grey66"
1313
 $ 169,169,169: chr [1:2] "darkgray" "darkgrey"
1314
 $ 169,169,169: chr [1:2] "darkgray" "darkgrey"
1314
 $ 171,171,171: chr [1:2] "gray67" "grey67"
1315
 $ 171,171,171: chr [1:2] "gray67" "grey67"
1315
 $ 173,173,173: chr [1:2] "gray68" "grey68"
1316
 $ 173,173,173: chr [1:2] "gray68" "grey68"
1316
 $ 176,176,176: chr [1:2] "gray69" "grey69"
1317
 $ 176,176,176: chr [1:2] "gray69" "grey69"
1317
 $ 179,179,179: chr [1:2] "gray70" "grey70"
1318
 $ 179,179,179: chr [1:2] "gray70" "grey70"
1318
 $ 181,181,181: chr [1:2] "gray71" "grey71"
1319
 $ 181,181,181: chr [1:2] "gray71" "grey71"
1319
 $ 184,184,184: chr [1:2] "gray72" "grey72"
1320
 $ 184,184,184: chr [1:2] "gray72" "grey72"
1320
 $ 186,186,186: chr [1:2] "gray73" "grey73"
1321
 $ 186,186,186: chr [1:2] "gray73" "grey73"
1321
 $ 189,189,189: chr [1:2] "gray74" "grey74"
1322
 $ 189,189,189: chr [1:2] "gray74" "grey74"
1322
 $ 190,190,190: chr [1:2] "gray" "grey"
1323
 $ 190,190,190: chr [1:2] "gray" "grey"
1323
  [list output truncated]
1324
  [list output truncated]
1324
> ## Not run: 
1325
> ## Not run: 
1325
> ##D  if(require(xgobi)) { ## Look at the color cube dynamically :
1326
> ##D  if(require(xgobi)) { ## Look at the color cube dynamically :
1326
> ##D    tc <- t(crgb[, !duplicated(ccodes)])
1327
> ##D    tc <- t(crgb[, !duplicated(ccodes)])
1327
> ##D    table(is.gray <- tc[,1] == tc[,2] & tc[,2] == tc[,3])# (397, 105)
1328
> ##D    table(is.gray <- tc[,1] == tc[,2] & tc[,2] == tc[,3])# (397, 105)
1328
> ##D    xgobi(tc, color = c("gold", "gray")[1 + is.gray])
1329
> ##D    xgobi(tc, color = c("gold", "gray")[1 + is.gray])
1329
> ##D  }
1330
> ##D  }
1330
> ## End(Not run)
1331
> ## End(Not run)
1331
> 
1332
> 
1332
> 
1333
> 
1333
> 
1334
> 
1334
> cleanEx()
1335
> cleanEx()
1335
> nameEx("colorRamp")
1336
> nameEx("colorRamp")
1336
> ### * colorRamp
1337
> ### * colorRamp
1337
> 
1338
> 
1338
> flush(stderr()); flush(stdout())
1339
> flush(stderr()); flush(stdout())
1339
> 
1340
> 
1340
> ### Name: colorRamp
1341
> ### Name: colorRamp
1341
> ### Title: Color interpolation
1342
> ### Title: Color interpolation
1342
> ### Aliases: colorRamp colorRampPalette
1343
> ### Aliases: colorRamp colorRampPalette
1343
> ### Keywords: color
1344
> ### Keywords: color
1344
> 
1345
> 
1345
> ### ** Examples
1346
> ### ** Examples
1346
> 
1347
> 
1347
> require(graphics)
1348
> require(graphics)
1348
> 
1349
> 
1349
> ## Here space="rgb" gives palettes that vary only in saturation,
1350
> ## Here space="rgb" gives palettes that vary only in saturation,
1350
> ## as intended.
1351
> ## as intended.
1351
> ## With space="Lab" the steps are more uniform, but the hues
1352
> ## With space="Lab" the steps are more uniform, but the hues
1352
> ## are slightly purple.
1353
> ## are slightly purple.
1353
> filled.contour(volcano,
1354
> filled.contour(volcano,
1354
+                color.palette =
1355
+                color.palette =
1355
+                    colorRampPalette(c("red", "white", "blue")),
1356
+                    colorRampPalette(c("red", "white", "blue")),
1356
+                asp = 1)
1357
+                asp = 1)
1357
> filled.contour(volcano,
1358
> filled.contour(volcano,
1358
+                color.palette =
1359
+                color.palette =
1359
+                    colorRampPalette(c("red", "white", "blue"),
1360
+                    colorRampPalette(c("red", "white", "blue"),
1360
+                                     space = "Lab"),
1361
+                                     space = "Lab"),
1361
+                asp = 1)
1362
+                asp = 1)
1362
> 
1363
> 
1363
> ## Interpolating a 'sequential' ColorBrewer palette
1364
> ## Interpolating a 'sequential' ColorBrewer palette
1364
> YlOrBr <- c("#FFFFD4", "#FED98E", "#FE9929", "#D95F0E", "#993404")
1365
> YlOrBr <- c("#FFFFD4", "#FED98E", "#FE9929", "#D95F0E", "#993404")
1365
> filled.contour(volcano,
1366
> filled.contour(volcano,
1366
+                color.palette = colorRampPalette(YlOrBr, space = "Lab"),
1367
+                color.palette = colorRampPalette(YlOrBr, space = "Lab"),
1367
+                asp = 1)
1368
+                asp = 1)
1368
> filled.contour(volcano,
1369
> filled.contour(volcano,
1369
+                color.palette = colorRampPalette(YlOrBr, space = "Lab",
1370
+                color.palette = colorRampPalette(YlOrBr, space = "Lab",
1370
+                                                 bias = 0.5),
1371
+                                                 bias = 0.5),
1371
+                asp = 1)
1372
+                asp = 1)
1372
> 
1373
> 
1373
> ## 'jet.colors' is "as in Matlab"
1374
> ## 'jet.colors' is "as in Matlab"
1374
> ## (and hurting the eyes by over-saturation)
1375
> ## (and hurting the eyes by over-saturation)
1375
> jet.colors <-
1376
> jet.colors <-
1376
+   colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan",
1377
+   colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan",
1377
+                      "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))
1378
+                      "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))
1378
> filled.contour(volcano, color = jet.colors, asp = 1)
1379
> filled.contour(volcano, color = jet.colors, asp = 1)
1379
> 
1380
> 
1380
> ## space="Lab" helps when colors don't form a natural sequence
1381
> ## space="Lab" helps when colors don't form a natural sequence
1381
> m <- outer(1:20,1:20,function(x,y) sin(sqrt(x*y)/3))
1382
> m <- outer(1:20,1:20,function(x,y) sin(sqrt(x*y)/3))
1382
> rgb.palette <- colorRampPalette(c("red", "orange", "blue"),
1383
> rgb.palette <- colorRampPalette(c("red", "orange", "blue"),
1383
+                                 space = "rgb")
1384
+                                 space = "rgb")
1384
> Lab.palette <- colorRampPalette(c("red", "orange", "blue"),
1385
> Lab.palette <- colorRampPalette(c("red", "orange", "blue"),
1385
+                                 space = "Lab")
1386
+                                 space = "Lab")
1386
> filled.contour(m, col = rgb.palette(20))
1387
> filled.contour(m, col = rgb.palette(20))
1387
> filled.contour(m, col = Lab.palette(20))
1388
> filled.contour(m, col = Lab.palette(20))
1388
> 
1389
> 
1389
> 
1390
> 
1390
> 
1391
> 
1391
> cleanEx()
1392
> cleanEx()
1392
> nameEx("colors")
1393
> nameEx("colors")
1393
> ### * colors
1394
> ### * colors
1394
> 
1395
> 
1395
> flush(stderr()); flush(stdout())
1396
> flush(stderr()); flush(stdout())
1396
> 
1397
> 
1397
> ### Name: colors
1398
> ### Name: colors
1398
> ### Title: Color Names
1399
> ### Title: Color Names
1399
> ### Aliases: colors colours
1400
> ### Aliases: colors colours
1400
> ### Keywords: color dplot sysdata
1401
> ### Keywords: color dplot sysdata
1401
> 
1402
> 
1402
> ### ** Examples
1403
> ### ** Examples
1403
> 
1404
> 
1404
> cl <- colors()
1405
> cl <- colors()
1405
> length(cl); cl[1:20]
1406
> length(cl); cl[1:20]
1406
[1] 657
1407
[1] 657
1407
 [1] "white"         "aliceblue"     "antiquewhite"  "antiquewhite1"
1408
 [1] "white"         "aliceblue"     "antiquewhite"  "antiquewhite1"
1408
 [5] "antiquewhite2" "antiquewhite3" "antiquewhite4" "aquamarine"   
1409
 [5] "antiquewhite2" "antiquewhite3" "antiquewhite4" "aquamarine"   
1409
 [9] "aquamarine1"   "aquamarine2"   "aquamarine3"   "aquamarine4"  
1410
 [9] "aquamarine1"   "aquamarine2"   "aquamarine3"   "aquamarine4"  
1410
[13] "azure"         "azure1"        "azure2"        "azure3"       
1411
[13] "azure"         "azure1"        "azure2"        "azure3"       
1411
[17] "azure4"        "beige"         "bisque"        "bisque1"      
1412
[17] "azure4"        "beige"         "bisque"        "bisque1"      
1412
> 
1413
> 
1413
> 
1414
> 
1414
> 
1415
> 
1415
> cleanEx()
1416
> cleanEx()
1416
> nameEx("contourLines")
1417
> nameEx("contourLines")
1417
> ### * contourLines
1418
> ### * contourLines
1418
> 
1419
> 
1419
> flush(stderr()); flush(stdout())
1420
> flush(stderr()); flush(stdout())
1420
> 
1421
> 
1421
> ### Name: contourLines
1422
> ### Name: contourLines
1422
> ### Title: Calculate Contour Lines
1423
> ### Title: Calculate Contour Lines
1423
> ### Aliases: contourLines
1424
> ### Aliases: contourLines
1424
> ### Keywords: dplot
1425
> ### Keywords: dplot
1425
> 
1426
> 
1426
> ### ** Examples
1427
> ### ** Examples
1427
> 
1428
> 
1428
> x <- 10*1:nrow(volcano)
1429
> x <- 10*1:nrow(volcano)
1429
> y <- 10*1:ncol(volcano)
1430
> y <- 10*1:ncol(volcano)
1430
> contourLines(x, y, volcano)
1431
> contourLines(x, y, volcano)
1431
> 
1432
> 
1432
> 
1433
> 
1433
> 
1434
> 
1434
> cleanEx()
1435
> cleanEx()
1435
> nameEx("convertColor")
1436
> nameEx("convertColor")
1436
> ### * convertColor
1437
> ### * convertColor
1437
> 
1438
> 
1438
> flush(stderr()); flush(stdout())
1439
> flush(stderr()); flush(stdout())
1439
> 
1440
> 
1440
> ### Name: convertColor
1441
> ### Name: convertColor
1441
> ### Title: Convert between colour spaces
1442
> ### Title: Convert between colour spaces
1442
> ### Aliases: convertColor colorspaces
1443
> ### Aliases: convertColor colorspaces
1443
> ### Keywords: color
1444
> ### Keywords: color
1444
> 
1445
> 
1445
> ### ** Examples
1446
> ### ** Examples
1446
> 
1447
> 
1447
> require(graphics); require(stats) # for na.omit
1448
> require(graphics); require(stats) # for na.omit
1448
> par(mfrow=c(2,2))
1449
> par(mfrow=c(2,2))
1449
> ## The displayable colors from four planes of Lab space
1450
> ## The displayable colors from four planes of Lab space
1450
> ab <- expand.grid(a=(-10:15)*10,b=(-15:10)*10)
1451
> ab <- expand.grid(a=(-10:15)*10,b=(-15:10)*10)
1451
> 
1452
> 
1452
> Lab <- cbind(L=20,ab)
1453
> Lab <- cbind(L=20,ab)
1453
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1454
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1454
> clipped <- attr(na.omit(srgb),"na.action")
1455
> clipped <- attr(na.omit(srgb),"na.action")
1455
> srgb[clipped,] <- 0
1456
> srgb[clipped,] <- 0
1456
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1457
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1457
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1458
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1458
+   xlab="a",ylab="b",main="Lab: L=20")
1459
+   xlab="a",ylab="b",main="Lab: L=20")
1459
> 
1460
> 
1460
> Lab <- cbind(L=40,ab)
1461
> Lab <- cbind(L=40,ab)
1461
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1462
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1462
> clipped <- attr(na.omit(srgb),"na.action")
1463
> clipped <- attr(na.omit(srgb),"na.action")
1463
> srgb[clipped,] <- 0
1464
> srgb[clipped,] <- 0
1464
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1465
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1465
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1466
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1466
+   xlab="a",ylab="b",main="Lab: L=40")
1467
+   xlab="a",ylab="b",main="Lab: L=40")
1467
> 
1468
> 
1468
> Lab <- cbind(L=60,ab)
1469
> Lab <- cbind(L=60,ab)
1469
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1470
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1470
> clipped <- attr(na.omit(srgb),"na.action")
1471
> clipped <- attr(na.omit(srgb),"na.action")
1471
> srgb[clipped,] <- 0
1472
> srgb[clipped,] <- 0
1472
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1473
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1473
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1474
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1474
+   xlab="a",ylab="b",main="Lab: L=60")
1475
+   xlab="a",ylab="b",main="Lab: L=60")
1475
> 
1476
> 
1476
> Lab <- cbind(L=80,ab)
1477
> Lab <- cbind(L=80,ab)
1477
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1478
> srgb <- convertColor(Lab,from="Lab",to="sRGB",clip=NA)
1478
> clipped <- attr(na.omit(srgb),"na.action")
1479
> clipped <- attr(na.omit(srgb),"na.action")
1479
> srgb[clipped,] <- 0
1480
> srgb[clipped,] <- 0
1480
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1481
> cols <- rgb(srgb[,1],srgb[,2],srgb[,3])
1481
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1482
> image((-10:15)*10,(-15:10)*10,matrix(1:(26*26),ncol=26),col=cols,
1482
+   xlab="a",ylab="b",main="Lab: L=80")
1483
+   xlab="a",ylab="b",main="Lab: L=80")
1483
> 
1484
> 
1484
> (cols <- t(col2rgb(palette())))
1485
> (cols <- t(col2rgb(palette())))
1485
     red green blue
1486
     red green blue
1486
[1,]   0     0    0
1487
[1,]   0     0    0
1487
[2,] 255     0    0
1488
[2,] 255     0    0
1488
[3,]   0   205    0
1489
[3,]   0   205    0
1489
[4,]   0     0  255
1490
[4,]   0     0  255
1490
[5,]   0   255  255
1491
[5,]   0   255  255
1491
[6,] 255     0  255
1492
[6,] 255     0  255
1492
[7,] 255   255    0
1493
[7,] 255   255    0
1493
[8,] 190   190  190
1494
[8,] 190   190  190
1494
> zapsmall(lab <- convertColor(cols,from="sRGB",to="Lab",scale.in=255))
1495
> zapsmall(lab <- convertColor(cols,from="sRGB",to="Lab",scale.in=255))
1495
            L       a.x          b
1496
            L       a.x          b
1496
[1,]  0.00000   0.00000    0.00000
1497
[1,]  0.00000   0.00000    0.00000
1497
[2,] 53.48418  80.01027   67.38407
1498
[2,] 53.48418  80.01027   67.38407
1498
[3,] 71.91841 -73.33548   70.41134
1499
[3,] 71.91841 -73.33548   70.41134
1499
[4,] 32.24075  78.82042 -107.93632
1500
[4,] 32.24075  78.82042 -107.93632
1500
[5,] 91.01106 -48.46075  -14.29081
1501
[5,] 91.01106 -48.46075  -14.29081
1501
[6,] 60.50231  97.95195  -60.51490
1502
[6,] 60.50231  97.95195  -60.51490
1502
[7,] 97.14950 -21.36677   94.42044
1503
[7,] 97.14950 -21.36677   94.42044
1503
[8,] 76.97594   0.00000    0.00000
1504
[8,] 76.97594   0.00000    0.00000
1504
> round(convertColor(lab,from="Lab",to="sRGB",scale.out=255))
1505
> round(convertColor(lab,from="Lab",to="sRGB",scale.out=255))
1505
     [,1] [,2] [,3]
1506
     [,1] [,2] [,3]
1506
[1,]    0    0    0
1507
[1,]    0    0    0
1507
[2,]  255    0    0
1508
[2,]  255    0    0
1508
[3,]    0  205    0
1509
[3,]    0  205    0
1509
[4,]    0    0  255
1510
[4,]    0    0  255
1510
[5,]    0  255  255
1511
[5,]    0  255  255
1511
[6,]  255    0  255
1512
[6,]  255    0  255
1512
[7,]  255  255    0
1513
[7,]  255  255    0
1513
[8,]  190  190  190
1514
[8,]  190  190  190
1514
> 
1515
> 
1515
> 
1516
> 
1516
> 
1517
> 
1517
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1518
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1518
> cleanEx()
1519
> cleanEx()
1519
> nameEx("densCols")
1520
> nameEx("densCols")
1520
> ### * densCols
1521
> ### * densCols
1521
> 
1522
> 
1522
> flush(stderr()); flush(stdout())
1523
> flush(stderr()); flush(stdout())
1523
> 
1524
> 
1524
> ### Name: densCols
1525
> ### Name: densCols
1525
> ### Title: Colors for Smooth Density Plots
1526
> ### Title: Colors for Smooth Density Plots
1526
> ### Aliases: densCols blues9
1527
> ### Aliases: densCols blues9
1527
> ### Keywords: dplot
1528
> ### Keywords: dplot
1528
> 
1529
> 
1529
> ### ** Examples
1530
> ### ** Examples
1530
> 
1531
> 
1531
> x1  <- matrix(rnorm(1e3), ncol=2)
1532
> x1  <- matrix(rnorm(1e3), ncol=2)
1532
> x2  <- matrix(rnorm(1e3, mean=3, sd=1.5), ncol=2)
1533
> x2  <- matrix(rnorm(1e3, mean=3, sd=1.5), ncol=2)
1533
> x   <- rbind(x1,x2)
1534
> x   <- rbind(x1,x2)
1534
> 
1535
> 
1535
> dcols <- densCols(x)
1536
> dcols <- densCols(x)
1536
KernSmooth 2.23 loaded
1537
KernSmooth 2.23 loaded
1537
Copyright M. P. Wand 1997-2009
1538
Copyright M. P. Wand 1997-2009
1538
> graphics::plot(x, col = dcols, pch=20, main = "n = 1000")
1539
> graphics::plot(x, col = dcols, pch=20, main = "n = 1000")
1539
> 
1540
> 
1540
> 
1541
> 
1541
> 
1542
> 
1542
> cleanEx()
1543
> cleanEx()
1543
> nameEx("dev")
1544
> nameEx("dev")
1544
> ### * dev
1545
> ### * dev
1545
> 
1546
> 
1546
> flush(stderr()); flush(stdout())
1547
> flush(stderr()); flush(stdout())
1547
> 
1548
> 
1548
> ### Name: dev
1549
> ### Name: dev
1549
> ### Title: Control Multiple Devices
1550
> ### Title: Control Multiple Devices
1550
> ### Aliases: dev.cur dev.list dev.next dev.prev dev.off dev.set dev.new
1551
> ### Aliases: dev.cur dev.list dev.next dev.prev dev.off dev.set dev.new
1551
> ###   graphics.off
1552
> ###   graphics.off
1552
> ### Keywords: device iplot
1553
> ### Keywords: device iplot
1553
> 
1554
> 
1554
> ### ** Examples
1555
> ### ** Examples
1555
> 
1556
> 
1556
> ## Not run: 
1557
> ## Not run: 
1557
> ##D ## Unix-specific example
1558
> ##D ## Unix-specific example
1558
> ##D x11()
1559
> ##D x11()
1559
> ##D plot(1:10)
1560
> ##D plot(1:10)
1560
> ##D x11()
1561
> ##D x11()
1561
> ##D plot(rnorm(10))
1562
> ##D plot(rnorm(10))
1562
> ##D dev.set(dev.prev())
1563
> ##D dev.set(dev.prev())
1563
> ##D abline(0,1)# through the 1:10 points
1564
> ##D abline(0,1)# through the 1:10 points
1564
> ##D dev.set(dev.next())
1565
> ##D dev.set(dev.next())
1565
> ##D abline(h=0, col="gray")# for the residual plot
1566
> ##D abline(h=0, col="gray")# for the residual plot
1566
> ##D dev.set(dev.prev())
1567
> ##D dev.set(dev.prev())
1567
> ##D dev.off(); dev.off()#- close the two X devices
1568
> ##D dev.off(); dev.off()#- close the two X devices
1568
> ## End(Not run)
1569
> ## End(Not run)
1569
> 
1570
> 
1570
> 
1571
> 
1571
> 
1572
> 
1572
> cleanEx()
1573
> cleanEx()
1573
> nameEx("dev.interactive")
1574
> nameEx("dev.interactive")
1574
> ### * dev.interactive
1575
> ### * dev.interactive
1575
> 
1576
> 
1576
> flush(stderr()); flush(stdout())
1577
> flush(stderr()); flush(stdout())
1577
> 
1578
> 
1578
> ### Name: dev.interactive
1579
> ### Name: dev.interactive
1579
> ### Title: Is the Current Graphics Device Interactive?
1580
> ### Title: Is the Current Graphics Device Interactive?
1580
> ### Aliases: dev.interactive deviceIsInteractive
1581
> ### Aliases: dev.interactive deviceIsInteractive
1581
> ### Keywords: device
1582
> ### Keywords: device
1582
> 
1583
> 
1583
> ### ** Examples
1584
> ### ** Examples
1584
> 
1585
> 
1585
> dev.interactive()
1586
> dev.interactive()
1586
[1] FALSE
1587
[1] FALSE
1587
> print(deviceIsInteractive(NULL))
1588
> print(deviceIsInteractive(NULL))
1588
[1] "X11"      "X11cairo" "quartz"   "windows"  "JavaGD"   "CairoWin" "CairoX11"
1589
[1] "X11"      "X11cairo" "quartz"   "windows"  "JavaGD"   "CairoWin" "CairoX11"
1589
> 
1590
> 
1590
> 
1591
> 
1591
> 
1592
> 
1592
> cleanEx()
1593
> cleanEx()
1593
> nameEx("dev.size")
1594
> nameEx("dev.size")
1594
> ### * dev.size
1595
> ### * dev.size
1595
> 
1596
> 
1596
> flush(stderr()); flush(stdout())
1597
> flush(stderr()); flush(stdout())
1597
> 
1598
> 
1598
> ### Name: dev.size
1599
> ### Name: dev.size
1599
> ### Title: Find Size of Device Surface
1600
> ### Title: Find Size of Device Surface
1600
> ### Aliases: dev.size
1601
> ### Aliases: dev.size
1601
> ### Keywords: dplot
1602
> ### Keywords: dplot
1602
> 
1603
> 
1603
> ### ** Examples
1604
> ### ** Examples
1604
> 
1605
> 
1605
> dev.size("cm")
1606
> dev.size("cm")
1606
[1] 17.78 17.78
1607
[1] 17.78 17.78
1607
> 
1608
> 
1608
> 
1609
> 
1609
> 
1610
> 
1610
> cleanEx()
1611
> cleanEx()
1611
> nameEx("dev2")
1612
> nameEx("dev2")
1612
> ### * dev2
1613
> ### * dev2
1613
> 
1614
> 
1614
> flush(stderr()); flush(stdout())
1615
> flush(stderr()); flush(stdout())
1615
> 
1616
> 
1616
> ### Name: dev2
1617
> ### Name: dev2
1617
> ### Title: Copy Graphics Between Multiple Devices
1618
> ### Title: Copy Graphics Between Multiple Devices
1618
> ### Aliases: dev.copy dev.print dev.copy2eps dev.copy2pdf dev.control
1619
> ### Aliases: dev.copy dev.print dev.copy2eps dev.copy2pdf dev.control
1619
> ### Keywords: device
1620
> ### Keywords: device
1620
> 
1621
> 
1621
> ### ** Examples
1622
> ### ** Examples
1622
> 
1623
> 
1623
> ## Not run: 
1624
> ## Not run: 
1624
> ##D x11()
1625
> ##D x11()
1625
> ##D plot(rnorm(10), main="Plot 1")
1626
> ##D plot(rnorm(10), main="Plot 1")
1626
> ##D dev.copy(device=x11)
1627
> ##D dev.copy(device=x11)
1627
> ##D mtext("Copy 1", 3)
1628
> ##D mtext("Copy 1", 3)
1628
> ##D dev.print(width=6, height=6, horizontal=FALSE) # prints it
1629
> ##D dev.print(width=6, height=6, horizontal=FALSE) # prints it
1629
> ##D dev.off(dev.prev())
1630
> ##D dev.off(dev.prev())
1630
> ##D dev.off()
1631
> ##D dev.off()
1631
> ## End(Not run)
1632
> ## End(Not run)
1632
> 
1633
> 
1633
> 
1634
> 
1634
> 
1635
> 
1635
> cleanEx()
1636
> cleanEx()
1636
> nameEx("extendrange")
1637
> nameEx("extendrange")
1637
> ### * extendrange
1638
> ### * extendrange
1638
> 
1639
> 
1639
> flush(stderr()); flush(stdout())
1640
> flush(stderr()); flush(stdout())
1640
> 
1641
> 
1641
> ### Name: extendrange
1642
> ### Name: extendrange
1642
> ### Title: Extend a Numerical Range by a Small Percentage
1643
> ### Title: Extend a Numerical Range by a Small Percentage
1643
> ### Aliases: extendrange
1644
> ### Aliases: extendrange
1644
> ### Keywords: dplot
1645
> ### Keywords: dplot
1645
> 
1646
> 
1646
> ### ** Examples
1647
> ### ** Examples
1647
> 
1648
> 
1648
> x <- 1:5
1649
> x <- 1:5
1649
> (r <- range(x))         # 1    5
1650
> (r <- range(x))         # 1    5
1650
[1] 1 5
1651
[1] 1 5
1651
> extendrange(x)          # 0.8  5.2
1652
> extendrange(x)          # 0.8  5.2
1652
[1] 0.8 5.2
1653
[1] 0.8 5.2
1653
> extendrange(x, f= 0.01) # 0.96 5.04
1654
> extendrange(x, f= 0.01) # 0.96 5.04
1654
[1] 0.96 5.04
1655
[1] 0.96 5.04
1655
> ## Use 'r' if you have it already:
1656
> ## Use 'r' if you have it already:
1656
> stopifnot(identical(extendrange(r=r),
1657
> stopifnot(identical(extendrange(r=r),
1657
+                     extendrange(x)))
1658
+                     extendrange(x)))
1658
> 
1659
> 
1659
> 
1660
> 
1660
> 
1661
> 
1661
> cleanEx()
1662
> cleanEx()
1662
> nameEx("getGraphicsEvent")
1663
> nameEx("getGraphicsEvent")
1663
> ### * getGraphicsEvent
1664
> ### * getGraphicsEvent
1664
> 
1665
> 
1665
> flush(stderr()); flush(stdout())
1666
> flush(stderr()); flush(stdout())
1666
> 
1667
> 
1667
> ### Name: getGraphicsEvent
1668
> ### Name: getGraphicsEvent
1668
> ### Title: Wait for a mouse or keyboard event from a graphics window
1669
> ### Title: Wait for a mouse or keyboard event from a graphics window
1669
> ### Aliases: getGraphicsEvent setGraphicsEventHandlers getGraphicsEventEnv
1670
> ### Aliases: getGraphicsEvent setGraphicsEventHandlers getGraphicsEventEnv
1670
> ###   setGraphicsEventEnv
1671
> ###   setGraphicsEventEnv
1671
> ### Keywords: iplot
1672
> ### Keywords: iplot
1672
> 
1673
> 
1673
> ### ** Examples
1674
> ### ** Examples
1674
> 
1675
> 
1675
> 
1676
> 
1676
> 
1677
> 
1677
> 
1678
> 
1678
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1679
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1679
> cleanEx()
1680
> cleanEx()
1680
> nameEx("gray")
1681
> nameEx("gray")
1681
> ### * gray
1682
> ### * gray
1682
> 
1683
> 
1683
> flush(stderr()); flush(stdout())
1684
> flush(stderr()); flush(stdout())
1684
> 
1685
> 
1685
> ### Name: gray
1686
> ### Name: gray
1686
> ### Title: Gray Level Specification
1687
> ### Title: Gray Level Specification
1687
> ### Aliases: gray grey
1688
> ### Aliases: gray grey
1688
> ### Keywords: color
1689
> ### Keywords: color
1689
> 
1690
> 
1690
> ### ** Examples
1691
> ### ** Examples
1691
> 
1692
> 
1692
> gray(0:8 / 8)
1693
> gray(0:8 / 8)
1693
[1] "#000000" "#202020" "#404040" "#606060" "#808080" "#9F9F9F" "#BFBFBF"
1694
[1] "#000000" "#202020" "#404040" "#606060" "#808080" "#9F9F9F" "#BFBFBF"
1694
[8] "#DFDFDF" "#FFFFFF"
1695
[8] "#DFDFDF" "#FFFFFF"
1695
> 
1696
> 
1696
> 
1697
> 
1697
> 
1698
> 
1698
> cleanEx()
1699
> cleanEx()
1699
> nameEx("gray.colors")
1700
> nameEx("gray.colors")
1700
> ### * gray.colors
1701
> ### * gray.colors
1701
> 
1702
> 
1702
> flush(stderr()); flush(stdout())
1703
> flush(stderr()); flush(stdout())
1703
> 
1704
> 
1704
> ### Name: gray.colors
1705
> ### Name: gray.colors
1705
> ### Title: Gray Color Palette
1706
> ### Title: Gray Color Palette
1706
> ### Aliases: gray.colors grey.colors
1707
> ### Aliases: gray.colors grey.colors
1707
> ### Keywords: color
1708
> ### Keywords: color
1708
> 
1709
> 
1709
> ### ** Examples
1710
> ### ** Examples
1710
> 
1711
> 
1711
> require(graphics)
1712
> require(graphics)
1712
> 
1713
> 
1713
> pie(rep(1,12), col = gray.colors(12))
1714
> pie(rep(1,12), col = gray.colors(12))
1714
> barplot(1:12, col = gray.colors(12))
1715
> barplot(1:12, col = gray.colors(12))
1715
> 
1716
> 
1716
> 
1717
> 
1717
> 
1718
> 
1718
> cleanEx()
1719
> cleanEx()
1719
> nameEx("hcl")
1720
> nameEx("hcl")
1720
> ### * hcl
1721
> ### * hcl
1721
> 
1722
> 
1722
> flush(stderr()); flush(stdout())
1723
> flush(stderr()); flush(stdout())
1723
> 
1724
> 
1724
> ### Name: hcl
1725
> ### Name: hcl
1725
> ### Title: HCL Color Specification
1726
> ### Title: HCL Color Specification
1726
> ### Aliases: hcl
1727
> ### Aliases: hcl
1727
> ### Keywords: color dplot
1728
> ### Keywords: color dplot
1728
> 
1729
> 
1729
> ### ** Examples
1730
> ### ** Examples
1730
> 
1731
> 
1731
> require(graphics)
1732
> require(graphics)
1732
> 
1733
> 
1733
> # The Foley and Van Dam PhD Data.
1734
> # The Foley and Van Dam PhD Data.
1734
> csd <- matrix(c( 4,2,4,6, 4,3,1,4, 4,7,7,1,
1735
> csd <- matrix(c( 4,2,4,6, 4,3,1,4, 4,7,7,1,
1735
+                  0,7,3,2, 4,5,3,2, 5,4,2,2,
1736
+                  0,7,3,2, 4,5,3,2, 5,4,2,2,
1736
+                  3,1,3,0, 4,4,6,7, 1,10,8,7,
1737
+                  3,1,3,0, 4,4,6,7, 1,10,8,7,
1737
+                  1,5,3,2, 1,5,2,1, 4,1,4,3,
1738
+                  1,5,3,2, 1,5,2,1, 4,1,4,3,
1738
+                  0,3,0,6, 2,1,5,5), nrow=4)
1739
+                  0,3,0,6, 2,1,5,5), nrow=4)
1739
> 
1740
> 
1740
> csphd <- function(colors)
1741
> csphd <- function(colors)
1741
+   barplot(csd, col = colors, ylim = c(0,30),
1742
+   barplot(csd, col = colors, ylim = c(0,30),
1742
+           names = 72:85, xlab = "Year", ylab = "Students",
1743
+           names = 72:85, xlab = "Year", ylab = "Students",
1743
+           legend = c("Winter", "Spring", "Summer", "Fall"),
1744
+           legend = c("Winter", "Spring", "Summer", "Fall"),
1744
+           main = "Computer Science PhD Graduates", las = 1)
1745
+           main = "Computer Science PhD Graduates", las = 1)
1745
> 
1746
> 
1746
> # The Original (Metaphorical) Colors (Ouch!)
1747
> # The Original (Metaphorical) Colors (Ouch!)
1747
> csphd(c("blue", "green", "yellow", "orange"))
1748
> csphd(c("blue", "green", "yellow", "orange"))
1748
> 
1749
> 
1749
> # A Color Tetrad (Maximal Color Differences)
1750
> # A Color Tetrad (Maximal Color Differences)
1750
> csphd(hcl(h = c(30, 120, 210, 300)))
1751
> csphd(hcl(h = c(30, 120, 210, 300)))
1751
> 
1752
> 
1752
> # Same, but lighter and less colorful
1753
> # Same, but lighter and less colorful
1753
> # Turn of automatic correction to make sure
1754
> # Turn of automatic correction to make sure
1754
> # that we have defined real colors.
1755
> # that we have defined real colors.
1755
> csphd(hcl(h = c(30, 120, 210, 300),
1756
> csphd(hcl(h = c(30, 120, 210, 300),
1756
+           c = 20, l = 90, fixup = FALSE))
1757
+           c = 20, l = 90, fixup = FALSE))
1757
> 
1758
> 
1758
> # Analogous Colors
1759
> # Analogous Colors
1759
> # Good for those with red/green color confusion
1760
> # Good for those with red/green color confusion
1760
> csphd(hcl(h = seq(60, 240, by = 60)))
1761
> csphd(hcl(h = seq(60, 240, by = 60)))
1761
> 
1762
> 
1762
> # Metaphorical Colors
1763
> # Metaphorical Colors
1763
> csphd(hcl(h = seq(210, 60, length = 4)))
1764
> csphd(hcl(h = seq(210, 60, length = 4)))
1764
> 
1765
> 
1765
> # Cool Colors
1766
> # Cool Colors
1766
> csphd(hcl(h = seq(120, 0, length = 4) + 150))
1767
> csphd(hcl(h = seq(120, 0, length = 4) + 150))
1767
> 
1768
> 
1768
> # Warm Colors
1769
> # Warm Colors
1769
> csphd(hcl(h = seq(120, 0, length = 4) - 30))
1770
> csphd(hcl(h = seq(120, 0, length = 4) - 30))
1770
> 
1771
> 
1771
> # Single Color
1772
> # Single Color
1772
> hist(stats::rnorm(1000), col = hcl(240))
1773
> hist(stats::rnorm(1000), col = hcl(240))
1773
> 
1774
> 
1774
> 
1775
> 
1775
> 
1776
> 
1776
> cleanEx()
1777
> cleanEx()
1777
> nameEx("hsv")
1778
> nameEx("hsv")
1778
> ### * hsv
1779
> ### * hsv
1779
> 
1780
> 
1780
> flush(stderr()); flush(stdout())
1781
> flush(stderr()); flush(stdout())
1781
> 
1782
> 
1782
> ### Name: hsv
1783
> ### Name: hsv
1783
> ### Title: HSV Color Specification
1784
> ### Title: HSV Color Specification
1784
> ### Aliases: hsv
1785
> ### Aliases: hsv
1785
> ### Keywords: color dplot
1786
> ### Keywords: color dplot
1786
> 
1787
> 
1787
> ### ** Examples
1788
> ### ** Examples
1788
> 
1789
> 
1789
> require(graphics)
1790
> require(graphics)
1790
> 
1791
> 
1791
> hsv(.5,.5,.5)
1792
> hsv(.5,.5,.5)
1792
[1] "#408080"
1793
[1] "#408080"
1793
> 
1794
> 
1794
> ## Look at gamma effect:
1795
> ## Look at gamma effect:
1795
> n <- 20;  y <- -sin(3*pi*((1:n)-1/2)/n)
1796
> n <- 20;  y <- -sin(3*pi*((1:n)-1/2)/n)
1796
> op <- par(mfrow=c(3,2),mar=rep(1.5,4))
1797
> op <- par(mfrow=c(3,2),mar=rep(1.5,4))
1797
> for(gamma in c(.4, .6, .8, 1, 1.2, 1.5))
1798
> for(gamma in c(.4, .6, .8, 1, 1.2, 1.5))
1798
+   plot(y, axes = FALSE, frame.plot = TRUE,
1799
+   plot(y, axes = FALSE, frame.plot = TRUE,
1799
+        xlab = "", ylab = "", pch = 21, cex = 30,
1800
+        xlab = "", ylab = "", pch = 21, cex = 30,
1800
+        bg = rainbow(n, start=.85, end=.1, gamma = gamma),
1801
+        bg = rainbow(n, start=.85, end=.1, gamma = gamma),
1801
+        main = paste("Red tones;  gamma=",format(gamma)))
1802
+        main = paste("Red tones;  gamma=",format(gamma)))
1802
> par(op)
1803
> par(op)
1803
> 
1804
> 
1804
> 
1805
> 
1805
> 
1806
> 
1806
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1807
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1807
> cleanEx()
1808
> cleanEx()
1808
> nameEx("make.rgb")
1809
> nameEx("make.rgb")
1809
> ### * make.rgb
1810
> ### * make.rgb
1810
> 
1811
> 
1811
> flush(stderr()); flush(stdout())
1812
> flush(stderr()); flush(stdout())
1812
> 
1813
> 
1813
> ### Name: make.rgb
1814
> ### Name: make.rgb
1814
> ### Title: Create colour spaces
1815
> ### Title: Create colour spaces
1815
> ### Aliases: make.rgb colorConverter
1816
> ### Aliases: make.rgb colorConverter
1816
> ### Keywords: color
1817
> ### Keywords: color
1817
> 
1818
> 
1818
> ### ** Examples
1819
> ### ** Examples
1819
> 
1820
> 
1820
> (pal <- make.rgb(red=  c(0.6400,0.3300),
1821
> (pal <- make.rgb(red=  c(0.6400,0.3300),
1821
+                  green=c(0.2900,0.6000),
1822
+                  green=c(0.2900,0.6000),
1822
+                  blue= c(0.1500,0.0600),
1823
+                  blue= c(0.1500,0.0600),
1823
+                  name = "PAL/SECAM RGB"))
1824
+                  name = "PAL/SECAM RGB"))
1824
Color space converter: PAL/SECAM RGB
1825
Color space converter: PAL/SECAM RGB
1825
Reference white: D65
1826
Reference white: D65
1826
display gamma = 2.2
1827
display gamma = 2.2
1827
> 
1828
> 
1828
> ## converter for sRGB in #rrggbb format
1829
> ## converter for sRGB in #rrggbb format
1829
> hexcolor <- colorConverter(toXYZ = function(hex,...) {
1830
> hexcolor <- colorConverter(toXYZ = function(hex,...) {
1830
+                             rgb <- t(col2rgb(hex))/255
1831
+                             rgb <- t(col2rgb(hex))/255
1831
+                             colorspaces$sRGB$toXYZ(rgb,...) },
1832
+                             colorspaces$sRGB$toXYZ(rgb,...) },
1832
+                            fromXYZ = function(xyz,...) {
1833
+                            fromXYZ = function(xyz,...) {
1833
+                               rgb <- colorspaces$sRGB$fromXYZ(xyz,..)
1834
+                               rgb <- colorspaces$sRGB$fromXYZ(xyz,..)
1834
+                               rgb <- round(rgb,5)
1835
+                               rgb <- round(rgb,5)
1835
+                               if (min(rgb) < 0 || max(rgb) > 1)
1836
+                               if (min(rgb) < 0 || max(rgb) > 1)
1836
+                                    as.character(NA)
1837
+                                    as.character(NA)
1837
+                               else
1838
+                               else
1838
+                                    rgb(rgb[1],rgb[2],rgb[3])},
1839
+                                    rgb(rgb[1],rgb[2],rgb[3])},
1839
+                            white = "D65", name = "#rrggbb")
1840
+                            white = "D65", name = "#rrggbb")
1840
> 
1841
> 
1841
> (cols <- t(col2rgb(palette())))
1842
> (cols <- t(col2rgb(palette())))
1842
     red green blue
1843
     red green blue
1843
[1,]   0     0    0
1844
[1,]   0     0    0
1844
[2,] 255     0    0
1845
[2,] 255     0    0
1845
[3,]   0   205    0
1846
[3,]   0   205    0
1846
[4,]   0     0  255
1847
[4,]   0     0  255
1847
[5,]   0   255  255
1848
[5,]   0   255  255
1848
[6,] 255     0  255
1849
[6,] 255     0  255
1849
[7,] 255   255    0
1850
[7,] 255   255    0
1850
[8,] 190   190  190
1851
[8,] 190   190  190
1851
> (luv <- convertColor(cols,from="sRGB", to="Luv", scale.in=255))
1852
> (luv <- convertColor(cols,from="sRGB", to="Luv", scale.in=255))
1852
            L             u             v
1853
            L             u             v
1853
[1,]  0.00000  0.000000e+00  0.000000e+00
1854
[1,]  0.00000  0.000000e+00  0.000000e+00
1854
[2,] 53.48418  1.753647e+02  3.780017e+01
1855
[2,] 53.48418  1.753647e+02  3.780017e+01
1855
[3,] 71.91841 -6.870661e+01  8.786408e+01
1856
[3,] 71.91841 -6.870661e+01  8.786408e+01
1856
[4,] 32.24075 -9.660595e+00 -1.301930e+02
1857
[4,] 32.24075 -9.660595e+00 -1.301930e+02
1857
[5,] 91.01106 -7.117303e+01 -1.534147e+01
1858
[5,] 91.01106 -7.117303e+01 -1.534147e+01
1858
[6,] 60.50231  8.456678e+01 -1.081465e+02
1859
[6,] 60.50231  8.456678e+01 -1.081465e+02
1859
[7,] 97.14950  7.898148e+00  1.064410e+02
1860
[7,] 97.14950  7.898148e+00  1.064410e+02
1860
[8,] 76.97594 -2.777465e-14 -5.554930e-14
1861
[8,] 76.97594 -2.777465e-14 -5.554930e-14
1861
> (hex <- convertColor(luv, from="Luv",  to=hexcolor, scale.out=NULL))
1862
> (hex <- convertColor(luv, from="Luv",  to=hexcolor, scale.out=NULL))
1862
[1] "#000000" "#FF0000" "#00CD00" "#0000FF" "#00FFFF" "#FF00FF" "#FFFF00"
1863
[1] "#000000" "#FF0000" "#00CD00" "#0000FF" "#00FFFF" "#FF00FF" "#FFFF00"
1863
[8] "#BEBEBE"
1864
[8] "#BEBEBE"
1864
> 
1865
> 
1865
> ## must make hex a matrix before using it
1866
> ## must make hex a matrix before using it
1866
> (cc <- round(convertColor(as.matrix(hex), from= hexcolor, to= "sRGB",
1867
> (cc <- round(convertColor(as.matrix(hex), from= hexcolor, to= "sRGB",
1867
+                           scale.in=NULL, scale.out=255)))
1868
+                           scale.in=NULL, scale.out=255)))
1868
     [,1] [,2] [,3]
1869
     [,1] [,2] [,3]
1869
[1,]    0    0    0
1870
[1,]    0    0    0
1870
[2,]  255    0    0
1871
[2,]  255    0    0
1871
[3,]    0  205    0
1872
[3,]    0  205    0
1872
[4,]    0    0  255
1873
[4,]    0    0  255
1873
[5,]    0  255  255
1874
[5,]    0  255  255
1874
[6,]  255    0  255
1875
[6,]  255    0  255
1875
[7,]  255  255    0
1876
[7,]  255  255    0
1876
[8,]  190  190  190
1877
[8,]  190  190  190
1877
> stopifnot(cc == cols)
1878
> stopifnot(cc == cols)
1878
> 
1879
> 
1879
> 
1880
> 
1880
> 
1881
> 
1881
> cleanEx()
1882
> cleanEx()
1882
> nameEx("n2mfrow")
1883
> nameEx("n2mfrow")
1883
> ### * n2mfrow
1884
> ### * n2mfrow
1884
> 
1885
> 
1885
> flush(stderr()); flush(stdout())
1886
> flush(stderr()); flush(stdout())
1886
> 
1887
> 
1887
> ### Name: n2mfrow
1888
> ### Name: n2mfrow
1888
> ### Title: Compute Default mfrow From Number of Plots
1889
> ### Title: Compute Default mfrow From Number of Plots
1889
> ### Aliases: n2mfrow
1890
> ### Aliases: n2mfrow
1890
> ### Keywords: dplot utilities
1891
> ### Keywords: dplot utilities
1891
> 
1892
> 
1892
> ### ** Examples
1893
> ### ** Examples
1893
> 
1894
> 
1894
> require(graphics)
1895
> require(graphics)
1895
> 
1896
> 
1896
> n2mfrow(8) # 3 x 3
1897
> n2mfrow(8) # 3 x 3
1897
[1] 3 3
1898
[1] 3 3
1898
> 
1899
> 
1899
> n <- 5 ; x <- seq(-2,2, len=51)
1900
> n <- 5 ; x <- seq(-2,2, len=51)
1900
> ## suppose now that 'n' is not known {inside function}
1901
> ## suppose now that 'n' is not known {inside function}
1901
> op <- par(mfrow = n2mfrow(n))
1902
> op <- par(mfrow = n2mfrow(n))
1902
> for (j in 1:n)
1903
> for (j in 1:n)
1903
+    plot(x, x^j, main = substitute(x^ exp, list(exp = j)), type = "l",
1904
+    plot(x, x^j, main = substitute(x^ exp, list(exp = j)), type = "l",
1904
+    col = "blue")
1905
+    col = "blue")
1905
> 
1906
> 
1906
> sapply(1:10, n2mfrow)
1907
> sapply(1:10, n2mfrow)
1907
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
1908
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
1908
[1,]    1    2    3    2    3    3    3    3    3     4
1909
[1,]    1    2    3    2    3    3    3    3    3     4
1909
[2,]    1    1    1    2    2    2    3    3    3     3
1910
[2,]    1    1    1    2    2    2    3    3    3     3
1910
> 
1911
> 
1911
> 
1912
> 
1912
> 
1913
> 
1913
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1914
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1914
> cleanEx()
1915
> cleanEx()
1915
> nameEx("nclass")
1916
> nameEx("nclass")
1916
> ### * nclass
1917
> ### * nclass
1917
> 
1918
> 
1918
> flush(stderr()); flush(stdout())
1919
> flush(stderr()); flush(stdout())
1919
> 
1920
> 
1920
> ### Name: nclass
1921
> ### Name: nclass
1921
> ### Title: Compute the Number of Classes for a Histogram
1922
> ### Title: Compute the Number of Classes for a Histogram
1922
> ### Aliases: nclass.Sturges nclass.scott nclass.FD
1923
> ### Aliases: nclass.Sturges nclass.scott nclass.FD
1923
> ### Keywords: univar
1924
> ### Keywords: univar
1924
> 
1925
> 
1925
> ### ** Examples
1926
> ### ** Examples
1926
> 
1927
> 
1927
> set.seed(1)
1928
> set.seed(1)
1928
> x <- stats::rnorm(1111)
1929
> x <- stats::rnorm(1111)
1929
> nclass.Sturges(x)
1930
> nclass.Sturges(x)
1930
[1] 12
1931
[1] 12
1931
> 
1932
> 
1932
> ## Compare them:
1933
> ## Compare them:
1933
> NC <- function(x) c(Sturges = nclass.Sturges(x),
1934
> NC <- function(x) c(Sturges = nclass.Sturges(x),
1934
+       Scott = nclass.scott(x), FD = nclass.FD(x))
1935
+       Scott = nclass.scott(x), FD = nclass.FD(x))
1935
> NC(x)
1936
> NC(x)
1936
Sturges   Scott      FD 
1937
Sturges   Scott      FD 
1937
     12      20      26 
1938
     12      20      26 
1938
> onePt <- rep(1, 11)
1939
> onePt <- rep(1, 11)
1939
> NC(onePt) # no longer gives NaN
1940
> NC(onePt) # no longer gives NaN
1940
Sturges   Scott      FD 
1941
Sturges   Scott      FD 
1941
      5       1       1 
1942
      5       1       1 
1942
> 
1943
> 
1943
> 
1944
> 
1944
> 
1945
> 
1945
> cleanEx()
1946
> cleanEx()
1946
> nameEx("palette")
1947
> nameEx("palette")
1947
> ### * palette
1948
> ### * palette
1948
> 
1949
> 
1949
> flush(stderr()); flush(stdout())
1950
> flush(stderr()); flush(stdout())
1950
> 
1951
> 
1951
> ### Name: palette
1952
> ### Name: palette
1952
> ### Title: Set or View the Graphics Palette
1953
> ### Title: Set or View the Graphics Palette
1953
> ### Aliases: palette
1954
> ### Aliases: palette
1954
> ### Keywords: color sysdata
1955
> ### Keywords: color sysdata
1955
> 
1956
> 
1956
> ### ** Examples
1957
> ### ** Examples
1957
> 
1958
> 
1958
> require(graphics)
1959
> require(graphics)
1959
> 
1960
> 
1960
> palette()               # obtain the current palette
1961
> palette()               # obtain the current palette
1961
[1] "black"   "red"     "green3"  "blue"    "cyan"    "magenta" "yellow" 
1962
[1] "black"   "red"     "green3"  "blue"    "cyan"    "magenta" "yellow" 
1962
[8] "gray"   
1963
[8] "gray"   
1963
> palette(rainbow(6))     # six color rainbow
1964
> palette(rainbow(6))     # six color rainbow
1964
> 
1965
> 
1965
> (palette(gray(seq(0,.9,len=25)))) # gray scales; print old palette
1966
> (palette(gray(seq(0,.9,len=25)))) # gray scales; print old palette
1966
[1] "red"     "yellow"  "green"   "cyan"    "blue"    "magenta"
1967
[1] "red"     "yellow"  "green"   "cyan"    "blue"    "magenta"
1967
> matplot(outer(1:100,1:30), type='l', lty=1,lwd=2, col=1:30,
1968
> matplot(outer(1:100,1:30), type='l', lty=1,lwd=2, col=1:30,
1968
+         main = "Gray Scales Palette",
1969
+         main = "Gray Scales Palette",
1969
+         sub = "palette(gray(seq(0,.9,len=25)))")
1970
+         sub = "palette(gray(seq(0,.9,len=25)))")
1970
> palette("default")      # reset back to the default
1971
> palette("default")      # reset back to the default
1971
> 
1972
> 
1972
> ## on a device where alpha-transparency is supported,
1973
> ## on a device where alpha-transparency is supported,
1973
> ##  use 'alpha = 0.3' transparency with the default palette :
1974
> ##  use 'alpha = 0.3' transparency with the default palette :
1974
> opal <- col2rgb(palette(), alpha=TRUE)/255; opal["alpha",] <- 0.3
1975
> opal <- col2rgb(palette(), alpha=TRUE)/255; opal["alpha",] <- 0.3
1975
> mycols <- do.call(rgb, as.list(as.data.frame(t(opal))))
1976
> mycols <- do.call(rgb, as.list(as.data.frame(t(opal))))
1976
> opal <- palette(mycols)
1977
> opal <- palette(mycols)
1977
> x <- rnorm(1000); xy <- cbind(x, 3*x + rnorm(1000))
1978
> x <- rnorm(1000); xy <- cbind(x, 3*x + rnorm(1000))
1978
> plot (xy, lwd=2,
1979
> plot (xy, lwd=2,
1979
+        main = "Alpha-Transparency Palette\n alpha = 0.3")
1980
+        main = "Alpha-Transparency Palette\n alpha = 0.3")
1980
> xy[,1] <- -xy[,1]
1981
> xy[,1] <- -xy[,1]
1981
> points(xy, col=8, pch=16, cex = 1.5)
1982
> points(xy, col=8, pch=16, cex = 1.5)
1982
Warning in plot.xy(xy.coords(x, y), type = type, ...) :
1983
Warning in plot.xy(xy.coords(x, y), type = type, ...) :
1983
  semi-transparency is not supported on this device: reported only once per page
1984
  semi-transparency is not supported on this device: reported only once per page
1984
> palette("default")
1985
> palette("default")
1985
> 
1986
> 
1986
> 
1987
> 
1987
> 
1988
> 
1988
> cleanEx()
1989
> cleanEx()
1989
> nameEx("palettes")
1990
> nameEx("palettes")
1990
> ### * palettes
1991
> ### * palettes
1991
> 
1992
> 
1992
> flush(stderr()); flush(stdout())
1993
> flush(stderr()); flush(stdout())
1993
> 
1994
> 
1994
> ### Name: Palettes
1995
> ### Name: Palettes
1995
> ### Title: Color Palettes
1996
> ### Title: Color Palettes
1996
> ### Aliases: rainbow heat.colors terrain.colors topo.colors cm.colors
1997
> ### Aliases: rainbow heat.colors terrain.colors topo.colors cm.colors
1997
> ### Keywords: color dplot
1998
> ### Keywords: color dplot
1998
> 
1999
> 
1999
> ### ** Examples
2000
> ### ** Examples
2000
> 
2001
> 
2001
> require(graphics)
2002
> require(graphics)
2002
> # A Color Wheel
2003
> # A Color Wheel
2003
> pie(rep(1,12), col=rainbow(12))
2004
> pie(rep(1,12), col=rainbow(12))
2004
> 
2005
> 
2005
> ##------ Some palettes ------------
2006
> ##------ Some palettes ------------
2006
> demo.pal <-
2007
> demo.pal <-
2007
+   function(n, border = if (n<32) "light gray" else NA,
2008
+   function(n, border = if (n<32) "light gray" else NA,
2008
+            main = paste("color palettes;  n=",n),
2009
+            main = paste("color palettes;  n=",n),
2009
+            ch.col = c("rainbow(n, start=.7, end=.1)", "heat.colors(n)",
2010
+            ch.col = c("rainbow(n, start=.7, end=.1)", "heat.colors(n)",
2010
+                       "terrain.colors(n)", "topo.colors(n)",
2011
+                       "terrain.colors(n)", "topo.colors(n)",
2011
+                       "cm.colors(n)"))
2012
+                       "cm.colors(n)"))
2012
+ {
2013
+ {
2013
+     nt <- length(ch.col)
2014
+     nt <- length(ch.col)
2014
+     i <- 1:n; j <- n / nt; d <- j/6; dy <- 2*d
2015
+     i <- 1:n; j <- n / nt; d <- j/6; dy <- 2*d
2015
+     plot(i,i+d, type="n", yaxt="n", ylab="", main=main)
2016
+     plot(i,i+d, type="n", yaxt="n", ylab="", main=main)
2016
+     for (k in 1:nt) {
2017
+     for (k in 1:nt) {
2017
+         rect(i-.5, (k-1)*j+ dy, i+.4, k*j,
2018
+         rect(i-.5, (k-1)*j+ dy, i+.4, k*j,
2018
+              col = eval(parse(text=ch.col[k])), border = border)
2019
+              col = eval(parse(text=ch.col[k])), border = border)
2019
+         text(2*j,  k * j +dy/4, ch.col[k])
2020
+         text(2*j,  k * j +dy/4, ch.col[k])
2020
+     }
2021
+     }
2021
+ }
2022
+ }
2022
> n <- if(.Device == "postscript") 64 else 16
2023
> n <- if(.Device == "postscript") 64 else 16
2023
>      # Since for screen, larger n may give color allocation problem
2024
>      # Since for screen, larger n may give color allocation problem
2024
> demo.pal(n)
2025
> demo.pal(n)
2025
> 
2026
> 
2026
> 
2027
> 
2027
> 
2028
> 
2028
> cleanEx()
2029
> cleanEx()
2029
> nameEx("pdf")
2030
> nameEx("pdf")
2030
> ### * pdf
2031
> ### * pdf
2031
> 
2032
> 
2032
> flush(stderr()); flush(stdout())
2033
> flush(stderr()); flush(stdout())
2033
> 
2034
> 
2034
> ### Name: pdf
2035
> ### Name: pdf
2035
> ### Title: PDF Graphics Device
2036
> ### Title: PDF Graphics Device
2036
> ### Aliases: pdf
2037
> ### Aliases: pdf
2037
> ### Keywords: device
2038
> ### Keywords: device
2038
> 
2039
> 
2039
> ### ** Examples
2040
> ### ** Examples
2040
> 
2041
> 
2041
> ## Not run: 
2042
> ## Not run: 
2042
> ##D ## Test function for encodings
2043
> ##D ## Test function for encodings
2043
> ##D TestChars <- function(encoding="ISOLatin1", ...)
2044
> ##D TestChars <- function(encoding="ISOLatin1", ...)
2044
> ##D {
2045
> ##D {
2045
> ##D     pdf(encoding=encoding, ...)
2046
> ##D     pdf(encoding=encoding, ...)
2046
> ##D     par(pty="s")
2047
> ##D     par(pty="s")
2047
> ##D     plot(c(-1,16), c(-1,16), type="n", xlab="", ylab="",
2048
> ##D     plot(c(-1,16), c(-1,16), type="n", xlab="", ylab="",
2048
> ##D          xaxs="i", yaxs="i")
2049
> ##D          xaxs="i", yaxs="i")
2049
> ##D          title(paste("Centred chars in encoding", encoding))
2050
> ##D          title(paste("Centred chars in encoding", encoding))
2050
> ##D     grid(17, 17, lty=1)
2051
> ##D     grid(17, 17, lty=1)
2051
> ##D     for(i in c(32:255)) {
2052
> ##D     for(i in c(32:255)) {
2052
> ##D         x <- i %% 16
2053
> ##D         x <- i %% 16
2053
> ##D         y <- i %/% 16
2054
> ##D         y <- i %/% 16
2054
> ##D         points(x, y, pch=i)
2055
> ##D         points(x, y, pch=i)
2055
> ##D     }
2056
> ##D     }
2056
> ##D     dev.off()
2057
> ##D     dev.off()
2057
> ##D }
2058
> ##D }
2058
> ##D ## there will be many warnings.
2059
> ##D ## there will be many warnings.
2059
> ##D TestChars("ISOLatin2")
2060
> ##D TestChars("ISOLatin2")
2060
> ##D ## this does not view properly in older viewers.
2061
> ##D ## this does not view properly in older viewers.
2061
> ##D TestChars("ISOLatin2", family="URWHelvetica")
2062
> ##D TestChars("ISOLatin2", family="URWHelvetica")
2062
> ##D ## works well for viewing in gs-based viewers, and often in xpdf.
2063
> ##D ## works well for viewing in gs-based viewers, and often in xpdf.
2063
> ## End(Not run)
2064
> ## End(Not run)
2064
> 
2065
> 
2065
> 
2066
> 
2066
> cleanEx()
2067
> cleanEx()
2067
> nameEx("pdf.options")
2068
> nameEx("pdf.options")
2068
> ### * pdf.options
2069
> ### * pdf.options
2069
> 
2070
> 
2070
> flush(stderr()); flush(stdout())
2071
> flush(stderr()); flush(stdout())
2071
> 
2072
> 
2072
> ### Name: pdf.options
2073
> ### Name: pdf.options
2073
> ### Title: Auxiliary Function to Set/View Defaults for Arguments of pdf
2074
> ### Title: Auxiliary Function to Set/View Defaults for Arguments of pdf
2074
> ### Aliases: pdf.options
2075
> ### Aliases: pdf.options
2075
> ### Keywords: device
2076
> ### Keywords: device
2076
> 
2077
> 
2077
> ### ** Examples
2078
> ### ** Examples
2078
> 
2079
> 
2079
> pdf.options(bg = "pink")
2080
> pdf.options(bg = "pink")
2080
> utils::str(pdf.options())
2081
> utils::str(pdf.options())
2081
List of 18
2082
List of 18
2082
 $ width      : num 7
2083
 $ width      : num 7
2083
 $ height     : num 7
2084
 $ height     : num 7
2084
 $ onefile    : logi TRUE
2085
 $ onefile    : logi TRUE
2085
 $ family     : chr "Helvetica"
2086
 $ family     : chr "Helvetica"
2086
 $ title      : chr "R Graphics Output"
2087
 $ title      : chr "R Graphics Output"
2087
 $ fonts      : NULL
2088
 $ fonts      : NULL
2088
 $ version    : chr "1.4"
2089
 $ version    : chr "1.4"
2089
 $ paper      : chr "special"
2090
 $ paper      : chr "special"
2090
 $ encoding   : chr "default"
2091
 $ encoding   : chr "default"
2091
 $ bg         : chr "pink"
2092
 $ bg         : chr "pink"
2092
 $ fg         : chr "black"
2093
 $ fg         : chr "black"
2093
 $ pointsize  : num 12
2094
 $ pointsize  : num 12
2094
 $ pagecentre : logi TRUE
2095
 $ pagecentre : logi TRUE
2095
 $ colormodel : chr "rgb"
2096
 $ colormodel : chr "rgb"
2096
 $ useDingbats: logi TRUE
2097
 $ useDingbats: logi TRUE
2097
 $ useKerning : logi TRUE
2098
 $ useKerning : logi TRUE
2098
 $ fillOddEven: logi FALSE
2099
 $ fillOddEven: logi FALSE
2099
 $ maxRasters : num 64
2100
 $ maxRasters : num 64
2100
> pdf.options(reset = TRUE) # back to factory-fresh
2101
> pdf.options(reset = TRUE) # back to factory-fresh
2101
> 
2102
> 
2102
> 
2103
> 
2103
> 
2104
> 
2104
> cleanEx()
2105
> cleanEx()
2105
> nameEx("pictex")
2106
> nameEx("pictex")
2106
> ### * pictex
2107
> ### * pictex
2107
> 
2108
> 
2108
> flush(stderr()); flush(stdout())
2109
> flush(stderr()); flush(stdout())
2109
> 
2110
> 
2110
> ### Name: pictex
2111
> ### Name: pictex
2111
> ### Title: A PicTeX Graphics Driver
2112
> ### Title: A PicTeX Graphics Driver
2112
> ### Aliases: pictex
2113
> ### Aliases: pictex
2113
> ### Keywords: device
2114
> ### Keywords: device
2114
> 
2115
> 
2115
> ### ** Examples
2116
> ### ** Examples
2116
> 
2117
> 
2117
> require(graphics)
2118
> require(graphics)
2118
> 
2119
> 
2119
> pictex()
2120
> pictex()
2120
> plot(1:11,(-5:5)^2, type='b', main="Simple Example Plot")
2121
> plot(1:11,(-5:5)^2, type='b', main="Simple Example Plot")
2121
> dev.off()
2122
> dev.off()
2122
postscript 
2123
postscript 
2123
         2 
2124
         2 
2124
> ##--------------------
2125
> ##--------------------
2125
> ## Not run: 
2126
> ## Not run: 
2126
> ##D %% LaTeX Example
2127
> ##D %% LaTeX Example
2127
> ##D \documentclass{article}
2128
> ##D \documentclass{article}
2128
> ##D \usepackage{pictex}
2129
> ##D \usepackage{pictex}
2129
> ##D \usepackage{graphics} % for \rotatebox
2130
> ##D \usepackage{graphics} % for \rotatebox
2130
> ##D \begin{document}
2131
> ##D \begin{document}
2131
> ##D %...
2132
> ##D %...
2132
> ##D \begin{figure}[h]
2133
> ##D \begin{figure}[h]
2133
> ##D   \centerline{\input{Rplots.tex}}
2134
> ##D   \centerline{\input{Rplots.tex}}
2134
> ##D   \caption{}
2135
> ##D   \caption{}
2135
> ##D \end{figure}
2136
> ##D \end{figure}
2136
> ##D %...
2137
> ##D %...
2137
> ##D \end{document}
2138
> ##D \end{document}
2138
> ## End(Not run)
2139
> ## End(Not run)
2139
> ##--------------------
2140
> ##--------------------
2140
> unlink("Rplots.tex")
2141
> unlink("Rplots.tex")
2141
> 
2142
> 
2142
> 
2143
> 
2143
> 
2144
> 
2144
> cleanEx()
2145
> cleanEx()
2145
> nameEx("plotmath")
2146
> nameEx("plotmath")
2146
> ### * plotmath
2147
> ### * plotmath
2147
> 
2148
> 
2148
> flush(stderr()); flush(stdout())
2149
> flush(stderr()); flush(stdout())
2149
> 
2150
> 
2150
> ### Name: plotmath
2151
> ### Name: plotmath
2151
> ### Title: Mathematical Annotation in R
2152
> ### Title: Mathematical Annotation in R
2152
> ### Aliases: plotmath symbol plain bold italic bolditalic hat bar dot ring
2153
> ### Aliases: plotmath symbol plain bold italic bolditalic hat bar dot ring
2153
> ###   widehat widetilde displaystyle textstyle scriptstyle
2154
> ###   widehat widetilde displaystyle textstyle scriptstyle
2154
> ###   scriptscriptstyle underline phantom over frac atop integral inf sup
2155
> ###   scriptscriptstyle underline phantom over frac atop integral inf sup
2155
> ###   group bgroup
2156
> ###   group bgroup
2156
> ### Keywords: aplot
2157
> ### Keywords: aplot
2157
> 
2158
> 
2158
> ### ** Examples
2159
> ### ** Examples
2159
> 
2160
> 
2160
> require(graphics)
2161
> require(graphics)
2161
> 
2162
> 
2162
> x <- seq(-4, 4, len = 101)
2163
> x <- seq(-4, 4, len = 101)
2163
> y <- cbind(sin(x), cos(x))
2164
> y <- cbind(sin(x), cos(x))
2164
> matplot(x, y, type = "l", xaxt = "n",
2165
> matplot(x, y, type = "l", xaxt = "n",
2165
+         main = expression(paste(plain(sin) * phi, "  and  ",
2166
+         main = expression(paste(plain(sin) * phi, "  and  ",
2166
+                                 plain(cos) * phi)),
2167
+                                 plain(cos) * phi)),
2167
+         ylab = expression("sin" * phi, "cos" * phi), # only 1st is taken
2168
+         ylab = expression("sin" * phi, "cos" * phi), # only 1st is taken
2168
+         xlab = expression(paste("Phase Angle ", phi)),
2169
+         xlab = expression(paste("Phase Angle ", phi)),
2169
+         col.main = "blue")
2170
+         col.main = "blue")
2170
> axis(1, at = c(-pi, -pi/2, 0, pi/2, pi),
2171
> axis(1, at = c(-pi, -pi/2, 0, pi/2, pi),
2171
+      labels = expression(-pi, -pi/2, 0, pi/2, pi))
2172
+      labels = expression(-pi, -pi/2, 0, pi/2, pi))
2172
> 
2173
> 
2173
> 
2174
> 
2174
> ## How to combine "math" and numeric variables :
2175
> ## How to combine "math" and numeric variables :
2175
> plot(1:10, type="n", xlab="", ylab="", main = "plot math & numbers")
2176
> plot(1:10, type="n", xlab="", ylab="", main = "plot math & numbers")
2176
> theta <- 1.23 ; mtext(bquote(hat(theta) == .(theta)), line= .25)
2177
> theta <- 1.23 ; mtext(bquote(hat(theta) == .(theta)), line= .25)
2177
> for(i in 2:9)
2178
> for(i in 2:9)
2178
+     text(i,i+1, substitute(list(xi,eta) == group("(",list(x,y),")"),
2179
+     text(i,i+1, substitute(list(xi,eta) == group("(",list(x,y),")"),
2179
+                            list(x=i, y=i+1)))
2180
+                            list(x=i, y=i+1)))
2180
> ## note that both of these use calls rather than expressions.
2181
> ## note that both of these use calls rather than expressions.
2181
> ##
2182
> ##
2182
> text(1,10,  "Derivatives:", adj=0)
2183
> text(1,10,  "Derivatives:", adj=0)
2183
> text(1,9.6, expression(
2184
> text(1,9.6, expression(
2184
+  "             first: {f * minute}(x) " == {f * minute}(x)), adj=0)
2185
+  "             first: {f * minute}(x) " == {f * minute}(x)), adj=0)
2185
> text(1,9.0, expression(
2186
> text(1,9.0, expression(
2186
+  "     second: {f * second}(x) "        == {f * second}(x)), adj=0)
2187
+  "     second: {f * second}(x) "        == {f * second}(x)), adj=0)
2187
> 
2188
> 
2188
> 
2189
> 
2189
> plot(1:10, 1:10)
2190
> plot(1:10, 1:10)
2190
> text(4, 9, expression(hat(beta) == (X^t * X)^{-1} * X^t * y))
2191
> text(4, 9, expression(hat(beta) == (X^t * X)^{-1} * X^t * y))
2191
> text(4, 8.4, "expression(hat(beta) == (X^t * X)^{-1} * X^t * y)",
2192
> text(4, 8.4, "expression(hat(beta) == (X^t * X)^{-1} * X^t * y)",
2192
+      cex = .8)
2193
+      cex = .8)
2193
> text(4, 7, expression(bar(x) == sum(frac(x[i], n), i==1, n)))
2194
> text(4, 7, expression(bar(x) == sum(frac(x[i], n), i==1, n)))
2194
> text(4, 6.4, "expression(bar(x) == sum(frac(x[i], n), i==1, n))",
2195
> text(4, 6.4, "expression(bar(x) == sum(frac(x[i], n), i==1, n))",
2195
+      cex = .8)
2196
+      cex = .8)
2196
> text(8, 5, expression(paste(frac(1, sigma*sqrt(2*pi)), " ",
2197
> text(8, 5, expression(paste(frac(1, sigma*sqrt(2*pi)), " ",
2197
+                             plain(e)^{frac(-(x-mu)^2, 2*sigma^2)})),
2198
+                             plain(e)^{frac(-(x-mu)^2, 2*sigma^2)})),
2198
+      cex = 1.2)
2199
+      cex = 1.2)
2199
> 
2200
> 
2200
> ## some other useful symbols
2201
> ## some other useful symbols
2201
> plot.new(); plot.window(c(0,4), c(15,1))
2202
> plot.new(); plot.window(c(0,4), c(15,1))
2202
> text(1, 1, "universal", adj=0); text(2.5, 1,  "\\042")
2203
> text(1, 1, "universal", adj=0); text(2.5, 1,  "\\042")
2203
> text(3, 1, expression(symbol("\042")))
2204
> text(3, 1, expression(symbol("\042")))
2204
> text(1, 2, "existential", adj=0); text(2.5, 2,  "\\044")
2205
> text(1, 2, "existential", adj=0); text(2.5, 2,  "\\044")
2205
> text(3, 2, expression(symbol("\044")))
2206
> text(3, 2, expression(symbol("\044")))
2206
> text(1, 3, "suchthat", adj=0); text(2.5, 3,  "\\047")
2207
> text(1, 3, "suchthat", adj=0); text(2.5, 3,  "\\047")
2207
> text(3, 3, expression(symbol("\047")))
2208
> text(3, 3, expression(symbol("\047")))
2208
> text(1, 4, "therefore", adj=0); text(2.5, 4,  "\\134")
2209
> text(1, 4, "therefore", adj=0); text(2.5, 4,  "\\134")
2209
> text(3, 4, expression(symbol("\134")))
2210
> text(3, 4, expression(symbol("\134")))
2210
> text(1, 5, "perpendicular", adj=0); text(2.5, 5,  "\\136")
2211
> text(1, 5, "perpendicular", adj=0); text(2.5, 5,  "\\136")
2211
> text(3, 5, expression(symbol("\136")))
2212
> text(3, 5, expression(symbol("\136")))
2212
> text(1, 6, "circlemultiply", adj=0); text(2.5, 6,  "\\304")
2213
> text(1, 6, "circlemultiply", adj=0); text(2.5, 6,  "\\304")
2213
> text(3, 6, expression(symbol("\304")))
2214
> text(3, 6, expression(symbol("\304")))
2214
> text(1, 7, "circleplus", adj=0); text(2.5, 7,  "\\305")
2215
> text(1, 7, "circleplus", adj=0); text(2.5, 7,  "\\305")
2215
> text(3, 7, expression(symbol("\305")))
2216
> text(3, 7, expression(symbol("\305")))
2216
> text(1, 8, "emptyset", adj=0); text(2.5, 8,  "\\306")
2217
> text(1, 8, "emptyset", adj=0); text(2.5, 8,  "\\306")
2217
> text(3, 8, expression(symbol("\306")))
2218
> text(3, 8, expression(symbol("\306")))
2218
> text(1, 9, "angle", adj=0); text(2.5, 9,  "\\320")
2219
> text(1, 9, "angle", adj=0); text(2.5, 9,  "\\320")
2219
> text(3, 9, expression(symbol("\320")))
2220
> text(3, 9, expression(symbol("\320")))
2220
> text(1, 10, "leftangle", adj=0); text(2.5, 10,  "\\341")
2221
> text(1, 10, "leftangle", adj=0); text(2.5, 10,  "\\341")
2221
> text(3, 10, expression(symbol("\341")))
2222
> text(3, 10, expression(symbol("\341")))
2222
> text(1, 11, "rightangle", adj=0); text(2.5, 11,  "\\361")
2223
> text(1, 11, "rightangle", adj=0); text(2.5, 11,  "\\361")
2223
> text(3, 11, expression(symbol("\361")))
2224
> text(3, 11, expression(symbol("\361")))
2224
> 
2225
> 
2225
> 
2226
> 
2226
> 
2227
> 
2227
> cleanEx()
2228
> cleanEx()
2228
> nameEx("postscriptFonts")
2229
> nameEx("postscriptFonts")
2229
> ### * postscriptFonts
2230
> ### * postscriptFonts
2230
> 
2231
> 
2231
> flush(stderr()); flush(stdout())
2232
> flush(stderr()); flush(stdout())
2232
> 
2233
> 
2233
> ### Name: postscriptFonts
2234
> ### Name: postscriptFonts
2234
> ### Title: PostScript and PDF Font Families
2235
> ### Title: PostScript and PDF Font Families
2235
> ### Aliases: postscriptFonts pdfFonts
2236
> ### Aliases: postscriptFonts pdfFonts
2236
> ### Keywords: device
2237
> ### Keywords: device
2237
> 
2238
> 
2238
> ### ** Examples
2239
> ### ** Examples
2239
> 
2240
> 
2240
> postscriptFonts()
2241
> postscriptFonts()
2241
$serif
2242
$serif
2242
$family
2243
$family
2243
[1] "Times"
2244
[1] "Times"
2244
 
2245
 
2245
$metrics
2246
$metrics
2246
[1] "Times-Roman.afm"      "Times-Bold.afm"       "Times-Italic.afm"    
2247
[1] "Times-Roman.afm"      "Times-Bold.afm"       "Times-Italic.afm"    
2247
[4] "Times-BoldItalic.afm" "Symbol.afm"          
2248
[4] "Times-BoldItalic.afm" "Symbol.afm"          
2248
 
2249
 
2249
$encoding
2250
$encoding
2250
[1] "default"
2251
[1] "default"
2251
 
2252
 
2252
attr(,"class")
2253
attr(,"class")
2253
[1] "Type1Font"
2254
[1] "Type1Font"
2254
 
2255
 
2255
$sans
2256
$sans
2256
$family
2257
$family
2257
[1] "Helvetica"
2258
[1] "Helvetica"
2258
 
2259
 
2259
$metrics
2260
$metrics
2260
[1] "Helvetica.afm"             "Helvetica-Bold.afm"       
2261
[1] "Helvetica.afm"             "Helvetica-Bold.afm"       
2261
[3] "Helvetica-Oblique.afm"     "Helvetica-BoldOblique.afm"
2262
[3] "Helvetica-Oblique.afm"     "Helvetica-BoldOblique.afm"
2262
[5] "Symbol.afm"               
2263
[5] "Symbol.afm"               
2263
 
2264
 
2264
$encoding
2265
$encoding
2265
[1] "default"
2266
[1] "default"
2266
 
2267
 
2267
attr(,"class")
2268
attr(,"class")
2268
[1] "Type1Font"
2269
[1] "Type1Font"
2269
 
2270
 
2270
$mono
2271
$mono
2271
$family
2272
$family
2272
[1] "Courier"
2273
[1] "Courier"
2273
 
2274
 
2274
$metrics
2275
$metrics
2275
[1] "Courier.afm"             "Courier-Bold.afm"       
2276
[1] "Courier.afm"             "Courier-Bold.afm"       
2276
[3] "Courier-Oblique.afm"     "Courier-BoldOblique.afm"
2277
[3] "Courier-Oblique.afm"     "Courier-BoldOblique.afm"
2277
[5] "Symbol.afm"             
2278
[5] "Symbol.afm"             
2278
 
2279
 
2279
$encoding
2280
$encoding
2280
[1] "default"
2281
[1] "default"
2281
 
2282
 
2282
attr(,"class")
2283
attr(,"class")
2283
[1] "Type1Font"
2284
[1] "Type1Font"
2284
 
2285
 
2285
$AvantGarde
2286
$AvantGarde
2286
$family
2287
$family
2287
[1] "AvantGarde"
2288
[1] "AvantGarde"
2288
 
2289
 
2289
$metrics
2290
$metrics
2290
[1] "agw_____.afm" "agd_____.afm" "agwo____.afm" "agdo____.afm" "Symbol.afm"  
2291
[1] "agw_____.afm" "agd_____.afm" "agwo____.afm" "agdo____.afm" "Symbol.afm"  
2291
 
2292
 
2292
$encoding
2293
$encoding
2293
[1] "default"
2294
[1] "default"
2294
 
2295
 
2295
attr(,"class")
2296
attr(,"class")
2296
[1] "Type1Font"
2297
[1] "Type1Font"
2297
 
2298
 
2298
$Bookman
2299
$Bookman
2299
$family
2300
$family
2300
[1] "Bookman"
2301
[1] "Bookman"
2301
 
2302
 
2302
$metrics
2303
$metrics
2303
[1] "bkl_____.afm" "bkd_____.afm" "bkli____.afm" "bkdi____.afm" "Symbol.afm"  
2304
[1] "bkl_____.afm" "bkd_____.afm" "bkli____.afm" "bkdi____.afm" "Symbol.afm"  
2304
 
2305
 
2305
$encoding
2306
$encoding
2306
[1] "default"
2307
[1] "default"
2307
 
2308
 
2308
attr(,"class")
2309
attr(,"class")
2309
[1] "Type1Font"
2310
[1] "Type1Font"
2310
 
2311
 
2311
$Courier
2312
$Courier
2312
$family
2313
$family
2313
[1] "Courier"
2314
[1] "Courier"
2314
 
2315
 
2315
$metrics
2316
$metrics
2316
[1] "Courier.afm"             "Courier-Bold.afm"       
2317
[1] "Courier.afm"             "Courier-Bold.afm"       
2317
[3] "Courier-Oblique.afm"     "Courier-BoldOblique.afm"
2318
[3] "Courier-Oblique.afm"     "Courier-BoldOblique.afm"
2318
[5] "Symbol.afm"             
2319
[5] "Symbol.afm"             
2319
 
2320
 
2320
$encoding
2321
$encoding
2321
[1] "default"
2322
[1] "default"
2322
 
2323
 
2323
attr(,"class")
2324
attr(,"class")
2324
[1] "Type1Font"
2325
[1] "Type1Font"
2325
 
2326
 
2326
$Helvetica
2327
$Helvetica
2327
$family
2328
$family
2328
[1] "Helvetica"
2329
[1] "Helvetica"
2329
 
2330
 
2330
$metrics
2331
$metrics
2331
[1] "Helvetica.afm"             "Helvetica-Bold.afm"       
2332
[1] "Helvetica.afm"             "Helvetica-Bold.afm"       
2332
[3] "Helvetica-Oblique.afm"     "Helvetica-BoldOblique.afm"
2333
[3] "Helvetica-Oblique.afm"     "Helvetica-BoldOblique.afm"
2333
[5] "Symbol.afm"               
2334
[5] "Symbol.afm"               
2334
 
2335
 
2335
$encoding
2336
$encoding
2336
[1] "default"
2337
[1] "default"
2337
 
2338
 
2338
attr(,"class")
2339
attr(,"class")
2339
[1] "Type1Font"
2340
[1] "Type1Font"
2340
 
2341
 
2341
$`Helvetica-Narrow`
2342
$`Helvetica-Narrow`
2342
$family
2343
$family
2343
[1] "Helvetica-Narrow"
2344
[1] "Helvetica-Narrow"
2344
 
2345
 
2345
$metrics
2346
$metrics
2346
[1] "hvn_____.afm" "hvnb____.afm" "hvno____.afm" "hvnbo___.afm" "Symbol.afm"  
2347
[1] "hvn_____.afm" "hvnb____.afm" "hvno____.afm" "hvnbo___.afm" "Symbol.afm"  
2347
 
2348
 
2348
$encoding
2349
$encoding
2349
[1] "default"
2350
[1] "default"
2350
 
2351
 
2351
attr(,"class")
2352
attr(,"class")
2352
[1] "Type1Font"
2353
[1] "Type1Font"
2353
 
2354
 
2354
$NewCenturySchoolbook
2355
$NewCenturySchoolbook
2355
$family
2356
$family
2356
[1] "NewCenturySchoolbook"
2357
[1] "NewCenturySchoolbook"
2357
 
2358
 
2358
$metrics
2359
$metrics
2359
[1] "ncr_____.afm" "ncb_____.afm" "nci_____.afm" "ncbi____.afm" "Symbol.afm"  
2360
[1] "ncr_____.afm" "ncb_____.afm" "nci_____.afm" "ncbi____.afm" "Symbol.afm"  
2360
 
2361
 
2361
$encoding
2362
$encoding
2362
[1] "default"
2363
[1] "default"
2363
 
2364
 
2364
attr(,"class")
2365
attr(,"class")
2365
[1] "Type1Font"
2366
[1] "Type1Font"
2366
 
2367
 
2367
$Palatino
2368
$Palatino
2368
$family
2369
$family
2369
[1] "Palatino"
2370
[1] "Palatino"
2370
 
2371
 
2371
$metrics
2372
$metrics
2372
[1] "por_____.afm" "pob_____.afm" "poi_____.afm" "pobi____.afm" "Symbol.afm"  
2373
[1] "por_____.afm" "pob_____.afm" "poi_____.afm" "pobi____.afm" "Symbol.afm"  
2373
 
2374
 
2374
$encoding
2375
$encoding
2375
[1] "default"
2376
[1] "default"
2376
 
2377
 
2377
attr(,"class")
2378
attr(,"class")
2378
[1] "Type1Font"
2379
[1] "Type1Font"
2379
 
2380
 
2380
$Times
2381
$Times
2381
$family
2382
$family
2382
[1] "Times"
2383
[1] "Times"
2383
 
2384
 
2384
$metrics
2385
$metrics
2385
[1] "Times-Roman.afm"      "Times-Bold.afm"       "Times-Italic.afm"    
2386
[1] "Times-Roman.afm"      "Times-Bold.afm"       "Times-Italic.afm"    
2386
[4] "Times-BoldItalic.afm" "Symbol.afm"          
2387
[4] "Times-BoldItalic.afm" "Symbol.afm"          
2387
 
2388
 
2388
$encoding
2389
$encoding
2389
[1] "default"
2390
[1] "default"
2390
 
2391
 
2391
attr(,"class")
2392
attr(,"class")
2392
[1] "Type1Font"
2393
[1] "Type1Font"
2393
 
2394
 
2394
$URWGothic
2395
$URWGothic
2395
$family
2396
$family
2396
[1] "URWGothic"
2397
[1] "URWGothic"
2397
 
2398
 
2398
$metrics
2399
$metrics
2399
[1] "a010013l.afm" "a010015l.afm" "a010033l.afm" "a010035l.afm" "s050000l.afm"
2400
[1] "a010013l.afm" "a010015l.afm" "a010033l.afm" "a010035l.afm" "s050000l.afm"
2400
 
2401
 
2401
$encoding
2402
$encoding
2402
[1] "default"
2403
[1] "default"
2403
 
2404
 
2404
attr(,"class")
2405
attr(,"class")
2405
[1] "Type1Font"
2406
[1] "Type1Font"
2406
 
2407
 
2407
$URWBookman
2408
$URWBookman
2408
$family
2409
$family
2409
[1] "URWBookman"
2410
[1] "URWBookman"
2410
 
2411
 
2411
$metrics
2412
$metrics
2412
[1] "b018012l.afm" "b018015l.afm" "b018032l.afm" "b018035l.afm" "s050000l.afm"
2413
[1] "b018012l.afm" "b018015l.afm" "b018032l.afm" "b018035l.afm" "s050000l.afm"
2413
 
2414
 
2414
$encoding
2415
$encoding
2415
[1] "default"
2416
[1] "default"
2416
 
2417
 
2417
attr(,"class")
2418
attr(,"class")
2418
[1] "Type1Font"
2419
[1] "Type1Font"
2419
 
2420
 
2420
$NimbusMon
2421
$NimbusMon
2421
$family
2422
$family
2422
[1] "NimbusMon"
2423
[1] "NimbusMon"
2423
 
2424
 
2424
$metrics
2425
$metrics
2425
[1] "n022003l.afm" "n022004l.afm" "n022023l.afm" "n022024l.afm" "s050000l.afm"
2426
[1] "n022003l.afm" "n022004l.afm" "n022023l.afm" "n022024l.afm" "s050000l.afm"
2426
 
2427
 
2427
$encoding
2428
$encoding
2428
[1] "default"
2429
[1] "default"
2429
 
2430
 
2430
attr(,"class")
2431
attr(,"class")
2431
[1] "Type1Font"
2432
[1] "Type1Font"
2432
 
2433
 
2433
$NimbusSan
2434
$NimbusSan
2434
$family
2435
$family
2435
[1] "NimbusSan"
2436
[1] "NimbusSan"
2436
 
2437
 
2437
$metrics
2438
$metrics
2438
[1] "n019003l.afm" "n019004l.afm" "n019023l.afm" "n019024l.afm" "s050000l.afm"
2439
[1] "n019003l.afm" "n019004l.afm" "n019023l.afm" "n019024l.afm" "s050000l.afm"
2439
 
2440
 
2440
$encoding
2441
$encoding
2441
[1] "default"
2442
[1] "default"
2442
 
2443
 
2443
attr(,"class")
2444
attr(,"class")
2444
[1] "Type1Font"
2445
[1] "Type1Font"
2445
 
2446
 
2446
$URWHelvetica
2447
$URWHelvetica
2447
$family
2448
$family
2448
[1] "URWHelvetica"
2449
[1] "URWHelvetica"
2449
 
2450
 
2450
$metrics
2451
$metrics
2451
[1] "n019003l.afm" "n019004l.afm" "n019023l.afm" "n019024l.afm" "s050000l.afm"
2452
[1] "n019003l.afm" "n019004l.afm" "n019023l.afm" "n019024l.afm" "s050000l.afm"
2452
 
2453
 
2453
$encoding
2454
$encoding
2454
[1] "default"
2455
[1] "default"
2455
 
2456
 
2456
attr(,"class")
2457
attr(,"class")
2457
[1] "Type1Font"
2458
[1] "Type1Font"
2458
 
2459
 
2459
$NimbusSanCond
2460
$NimbusSanCond
2460
$family
2461
$family
2461
[1] "NimbusSanCond"
2462
[1] "NimbusSanCond"
2462
 
2463
 
2463
$metrics
2464
$metrics
2464
[1] "n019043l.afm" "n019044l.afm" "n019063l.afm" "n019064l.afm" "s050000l.afm"
2465
[1] "n019043l.afm" "n019044l.afm" "n019063l.afm" "n019064l.afm" "s050000l.afm"
2465
 
2466
 
2466
$encoding
2467
$encoding
2467
[1] "default"
2468
[1] "default"
2468
 
2469
 
2469
attr(,"class")
2470
attr(,"class")
2470
[1] "Type1Font"
2471
[1] "Type1Font"
2471
 
2472
 
2472
$CenturySch
2473
$CenturySch
2473
$family
2474
$family
2474
[1] "CenturySch"
2475
[1] "CenturySch"
2475
 
2476
 
2476
$metrics
2477
$metrics
2477
[1] "c059013l.afm" "c059016l.afm" "c059033l.afm" "c059036l.afm" "s050000l.afm"
2478
[1] "c059013l.afm" "c059016l.afm" "c059033l.afm" "c059036l.afm" "s050000l.afm"
2478
 
2479
 
2479
$encoding
2480
$encoding
2480
[1] "default"
2481
[1] "default"
2481
 
2482
 
2482
attr(,"class")
2483
attr(,"class")
2483
[1] "Type1Font"
2484
[1] "Type1Font"
2484
 
2485
 
2485
$URWPalladio
2486
$URWPalladio
2486
$family
2487
$family
2487
[1] "URWPalladio"
2488
[1] "URWPalladio"
2488
 
2489
 
2489
$metrics
2490
$metrics
2490
[1] "p052003l.afm" "p052004l.afm" "p052023l.afm" "p052024l.afm" "s050000l.afm"
2491
[1] "p052003l.afm" "p052004l.afm" "p052023l.afm" "p052024l.afm" "s050000l.afm"
2491
 
2492
 
2492
$encoding
2493
$encoding
2493
[1] "default"
2494
[1] "default"
2494
 
2495
 
2495
attr(,"class")
2496
attr(,"class")
2496
[1] "Type1Font"
2497
[1] "Type1Font"
2497
 
2498
 
2498
$NimbusRom
2499
$NimbusRom
2499
$family
2500
$family
2500
[1] "NimbusRom"
2501
[1] "NimbusRom"
2501
 
2502
 
2502
$metrics
2503
$metrics
2503
[1] "n021003l.afm" "n021004l.afm" "n021023l.afm" "n021024l.afm" "s050000l.afm"
2504
[1] "n021003l.afm" "n021004l.afm" "n021023l.afm" "n021024l.afm" "s050000l.afm"
2504
 
2505
 
2505
$encoding
2506
$encoding
2506
[1] "default"
2507
[1] "default"
2507
 
2508
 
2508
attr(,"class")
2509
attr(,"class")
2509
[1] "Type1Font"
2510
[1] "Type1Font"
2510
 
2511
 
2511
$URWTimes
2512
$URWTimes
2512
$family
2513
$family
2513
[1] "URWTimes"
2514
[1] "URWTimes"
2514
 
2515
 
2515
$metrics
2516
$metrics
2516
[1] "n021003l.afm" "n021004l.afm" "n021023l.afm" "n021024l.afm" "s050000l.afm"
2517
[1] "n021003l.afm" "n021004l.afm" "n021023l.afm" "n021024l.afm" "s050000l.afm"
2517
 
2518
 
2518
$encoding
2519
$encoding
2519
[1] "default"
2520
[1] "default"
2520
 
2521
 
2521
attr(,"class")
2522
attr(,"class")
2522
[1] "Type1Font"
2523
[1] "Type1Font"
2523
 
2524
 
2524
$ComputerModern
2525
$ComputerModern
2525
$family
2526
$family
2526
[1] "ComputerModern"
2527
[1] "ComputerModern"
2527
 
2528
 
2528
$metrics
2529
$metrics
2529
[1] "CM_regular_10.afm"      "CM_boldx_10.afm"        "CM_italic_10.afm"      
2530
[1] "CM_regular_10.afm"      "CM_boldx_10.afm"        "CM_italic_10.afm"      
2530
[4] "CM_boldx_italic_10.afm" "CM_symbol_10.afm"      
2531
[4] "CM_boldx_italic_10.afm" "CM_symbol_10.afm"      
2531
 
2532
 
2532
$encoding
2533
$encoding
2533
[1] "TeXtext.enc"
2534
[1] "TeXtext.enc"
2534
 
2535
 
2535
attr(,"class")
2536
attr(,"class")
2536
[1] "Type1Font"
2537
[1] "Type1Font"
2537
 
2538
 
2538
$ComputerModernItalic
2539
$ComputerModernItalic
2539
$family
2540
$family
2540
[1] "ComputerModernItalic"
2541
[1] "ComputerModernItalic"
2541
 
2542
 
2542
$metrics
2543
$metrics
2543
[1] "CM_regular_10.afm" "CM_boldx_10.afm"   "cmti10.afm"       
2544
[1] "CM_regular_10.afm" "CM_boldx_10.afm"   "cmti10.afm"       
2544
[4] "cmbxti10.afm"      "CM_symbol_10.afm" 
2545
[4] "cmbxti10.afm"      "CM_symbol_10.afm" 
2545
 
2546
 
2546
$encoding
2547
$encoding
2547
[1] "TeXtext.enc"
2548
[1] "TeXtext.enc"
2548
 
2549
 
2549
attr(,"class")
2550
attr(,"class")
2550
[1] "Type1Font"
2551
[1] "Type1Font"
2551
 
2552
 
2552
$Japan1
2553
$Japan1
2553
$family
2554
$family
2554
[1] "HeiseiKakuGo-W5"
2555
[1] "HeiseiKakuGo-W5"
2555
 
2556
 
2556
$metrics
2557
$metrics
2557
[1] ""           ""           ""           ""           "Symbol.afm"
2558
[1] ""           ""           ""           ""           "Symbol.afm"
2558
 
2559
 
2559
$cmap
2560
$cmap
2560
[1] "EUC-H"
2561
[1] "EUC-H"
2561
 
2562
 
2562
$cmapEncoding
2563
$cmapEncoding
2563
[1] "EUC-JP"
2564
[1] "EUC-JP"
2564
 
2565
 
2565
$pdfresource
2566
$pdfresource
2566
[1] ""
2567
[1] ""
2567
 
2568
 
2568
attr(,"class")
2569
attr(,"class")
2569
[1] "CIDFont"
2570
[1] "CIDFont"
2570
 
2571
 
2571
$Japan1HeiMin
2572
$Japan1HeiMin
2572
$family
2573
$family
2573
[1] "HeiseiMin-W3"
2574
[1] "HeiseiMin-W3"
2574
 
2575
 
2575
$metrics
2576
$metrics
2576
[1] ""           ""           ""           ""           "Symbol.afm"
2577
[1] ""           ""           ""           ""           "Symbol.afm"
2577
 
2578
 
2578
$cmap
2579
$cmap
2579
[1] "EUC-H"
2580
[1] "EUC-H"
2580
 
2581
 
2581
$cmapEncoding
2582
$cmapEncoding
2582
[1] "EUC-JP"
2583
[1] "EUC-JP"
2583
 
2584
 
2584
$pdfresource
2585
$pdfresource
2585
[1] ""
2586
[1] ""
2586
 
2587
 
2587
attr(,"class")
2588
attr(,"class")
2588
[1] "CIDFont"
2589
[1] "CIDFont"
2589
 
2590
 
2590
$Japan1GothicBBB
2591
$Japan1GothicBBB
2591
$family
2592
$family
2592
[1] "GothicBBB-Medium"
2593
[1] "GothicBBB-Medium"
2593
 
2594
 
2594
$metrics
2595
$metrics
2595
[1] ""           ""           ""           ""           "Symbol.afm"
2596
[1] ""           ""           ""           ""           "Symbol.afm"
2596
 
2597
 
2597
$cmap
2598
$cmap
2598
[1] "EUC-H"
2599
[1] "EUC-H"
2599
 
2600
 
2600
$cmapEncoding
2601
$cmapEncoding
2601
[1] "EUC-JP"
2602
[1] "EUC-JP"
2602
 
2603
 
2603
$pdfresource
2604
$pdfresource
2604
[1] ""
2605
[1] ""
2605
 
2606
 
2606
attr(,"class")
2607
attr(,"class")
2607
[1] "CIDFont"
2608
[1] "CIDFont"
2608
 
2609
 
2609
$Japan1Ryumin
2610
$Japan1Ryumin
2610
$family
2611
$family
2611
[1] "Ryumin-Light"
2612
[1] "Ryumin-Light"
2612
 
2613
 
2613
$metrics
2614
$metrics
2614
[1] ""           ""           ""           ""           "Symbol.afm"
2615
[1] ""           ""           ""           ""           "Symbol.afm"
2615
 
2616
 
2616
$cmap
2617
$cmap
2617
[1] "EUC-H"
2618
[1] "EUC-H"
2618
 
2619
 
2619
$cmapEncoding
2620
$cmapEncoding
2620
[1] "EUC-JP"
2621
[1] "EUC-JP"
2621
 
2622
 
2622
$pdfresource
2623
$pdfresource
2623
[1] ""
2624
[1] ""
2624
 
2625
 
2625
attr(,"class")
2626
attr(,"class")
2626
[1] "CIDFont"
2627
[1] "CIDFont"
2627
 
2628
 
2628
$Korea1
2629
$Korea1
2629
$family
2630
$family
2630
[1] "Baekmuk-Batang"
2631
[1] "Baekmuk-Batang"
2631
 
2632
 
2632
$metrics
2633
$metrics
2633
[1] ""           ""           ""           ""           "Symbol.afm"
2634
[1] ""           ""           ""           ""           "Symbol.afm"
2634
 
2635
 
2635
$cmap
2636
$cmap
2636
[1] "KSCms-UHC-H"
2637
[1] "KSCms-UHC-H"
2637
 
2638
 
2638
$cmapEncoding
2639
$cmapEncoding
2639
[1] "CP949"
2640
[1] "CP949"
2640
 
2641
 
2641
$pdfresource
2642
$pdfresource
2642
[1] ""
2643
[1] ""
2643
 
2644
 
2644
attr(,"class")
2645
attr(,"class")
2645
[1] "CIDFont"
2646
[1] "CIDFont"
2646
 
2647
 
2647
$Korea1deb
2648
$Korea1deb
2648
$family
2649
$family
2649
[1] "Batang-Regular"
2650
[1] "Batang-Regular"
2650
 
2651
 
2651
$metrics
2652
$metrics
2652
[1] ""           ""           ""           ""           "Symbol.afm"
2653
[1] ""           ""           ""           ""           "Symbol.afm"
2653
 
2654
 
2654
$cmap
2655
$cmap
2655
[1] "KSCms-UHC-H"
2656
[1] "KSCms-UHC-H"
2656
 
2657
 
2657
$cmapEncoding
2658
$cmapEncoding
2658
[1] "CP949"
2659
[1] "CP949"
2659
 
2660
 
2660
$pdfresource
2661
$pdfresource
2661
[1] ""
2662
[1] ""
2662
 
2663
 
2663
attr(,"class")
2664
attr(,"class")
2664
[1] "CIDFont"
2665
[1] "CIDFont"
2665
 
2666
 
2666
$CNS1
2667
$CNS1
2667
$family
2668
$family
2668
[1] "MOESung-Regular"
2669
[1] "MOESung-Regular"
2669
 
2670
 
2670
$metrics
2671
$metrics
2671
[1] ""           ""           ""           ""           "Symbol.afm"
2672
[1] ""           ""           ""           ""           "Symbol.afm"
2672
 
2673
 
2673
$cmap
2674
$cmap
2674
[1] "B5pc-H"
2675
[1] "B5pc-H"
2675
 
2676
 
2676
$cmapEncoding
2677
$cmapEncoding
2677
[1] "CP950"
2678
[1] "CP950"
2678
 
2679
 
2679
$pdfresource
2680
$pdfresource
2680
[1] ""
2681
[1] ""
2681
 
2682
 
2682
attr(,"class")
2683
attr(,"class")
2683
[1] "CIDFont"
2684
[1] "CIDFont"
2684
 
2685
 
2685
$GB1
2686
$GB1
2686
$family
2687
$family
2687
[1] "BousungEG-Light-GB"
2688
[1] "BousungEG-Light-GB"
2688
 
2689
 
2689
$metrics
2690
$metrics
2690
[1] ""           ""           ""           ""           "Symbol.afm"
2691
[1] ""           ""           ""           ""           "Symbol.afm"
2691
 
2692
 
2692
$cmap
2693
$cmap
2693
[1] "GBK-EUC-H"
2694
[1] "GBK-EUC-H"
2694
 
2695
 
2695
$cmapEncoding
2696
$cmapEncoding
2696
[1] "GBK"
2697
[1] "GBK"
2697
 
2698
 
2698
$pdfresource
2699
$pdfresource
2699
[1] ""
2700
[1] ""
2700
 
2701
 
2701
attr(,"class")
2702
attr(,"class")
2702
[1] "CIDFont"
2703
[1] "CIDFont"
2703
 
2704
 
2704
> ## This duplicates "ComputerModernItalic".
2705
> ## This duplicates "ComputerModernItalic".
2705
> CMitalic <- Type1Font("ComputerModern2",
2706
> CMitalic <- Type1Font("ComputerModern2",
2706
+                       c("CM_regular_10.afm", "CM_boldx_10.afm",
2707
+                       c("CM_regular_10.afm", "CM_boldx_10.afm",
2707
+                         "cmti10.afm", "cmbxti10.afm",
2708
+                         "cmti10.afm", "cmbxti10.afm",
2708
+                          "CM_symbol_10.afm"),
2709
+                          "CM_symbol_10.afm"),
2709
+                       encoding = "TeXtext.enc")
2710
+                       encoding = "TeXtext.enc")
2710
> postscriptFonts(CMitalic = CMitalic)
2711
> postscriptFonts(CMitalic = CMitalic)
2711
> 
2712
> 
2712
> ## A CID font for Japanese using a different CMap and
2713
> ## A CID font for Japanese using a different CMap and
2713
> ## corresponding cmapEncoding.
2714
> ## corresponding cmapEncoding.
2714
> `Jp_UCS-2` <- CIDFont("TestUCS2",
2715
> `Jp_UCS-2` <- CIDFont("TestUCS2",
2715
+                   c("Adobe-Japan1-UniJIS-UCS2-H.afm",
2716
+                   c("Adobe-Japan1-UniJIS-UCS2-H.afm",
2716
+                     "Adobe-Japan1-UniJIS-UCS2-H.afm",
2717
+                     "Adobe-Japan1-UniJIS-UCS2-H.afm",
2717
+                     "Adobe-Japan1-UniJIS-UCS2-H.afm",
2718
+                     "Adobe-Japan1-UniJIS-UCS2-H.afm",
2718
+                     "Adobe-Japan1-UniJIS-UCS2-H.afm"),
2719
+                     "Adobe-Japan1-UniJIS-UCS2-H.afm"),
2719
+                   "UniJIS-UCS2-H", "UCS-2")
2720
+                   "UniJIS-UCS2-H", "UCS-2")
2720
> pdfFonts(`Jp_UCS-2` = `Jp_UCS-2`)
2721
> pdfFonts(`Jp_UCS-2` = `Jp_UCS-2`)
2721
> names(pdfFonts())
2722
> names(pdfFonts())
2722
 [1] "serif"                "sans"                 "mono"                
2723
 [1] "serif"                "sans"                 "mono"                
2723
 [4] "AvantGarde"           "Bookman"              "Courier"             
2724
 [4] "AvantGarde"           "Bookman"              "Courier"             
2724
 [7] "Helvetica"            "Helvetica-Narrow"     "NewCenturySchoolbook"
2725
 [7] "Helvetica"            "Helvetica-Narrow"     "NewCenturySchoolbook"
2725
[10] "Palatino"             "Times"                "URWGothic"           
2726
[10] "Palatino"             "Times"                "URWGothic"           
2726
[13] "URWBookman"           "NimbusMon"            "NimbusSan"           
2727
[13] "URWBookman"           "NimbusMon"            "NimbusSan"           
2727
[16] "URWHelvetica"         "NimbusSanCond"        "CenturySch"          
2728
[16] "URWHelvetica"         "NimbusSanCond"        "CenturySch"          
2728
[19] "URWPalladio"          "NimbusRom"            "URWTimes"            
2729
[19] "URWPalladio"          "NimbusRom"            "URWTimes"            
2729
[22] "Japan1"               "Japan1HeiMin"         "Japan1GothicBBB"     
2730
[22] "Japan1"               "Japan1HeiMin"         "Japan1GothicBBB"     
2730
[25] "Japan1Ryumin"         "Korea1"               "Korea1deb"           
2731
[25] "Japan1Ryumin"         "Korea1"               "Korea1deb"           
2731
[28] "CNS1"                 "GB1"                  "Jp_UCS-2"            
2732
[28] "CNS1"                 "GB1"                  "Jp_UCS-2"            
2732
> 
2733
> 
2733
> 
2734
> 
2734
> 
2735
> 
2735
> cleanEx()
2736
> cleanEx()
2736
> nameEx("pretty.Date")
2737
> nameEx("pretty.Date")
2737
> ### * pretty.Date
2738
> ### * pretty.Date
2738
> 
2739
> 
2739
> flush(stderr()); flush(stdout())
2740
> flush(stderr()); flush(stdout())
2740
> 
2741
> 
2741
> ### Name: pretty.Date
2742
> ### Name: pretty.Date
2742
> ### Title: Pretty Breakpoints for Date-Time Classes
2743
> ### Title: Pretty Breakpoints for Date-Time Classes
2743
> ### Aliases: pretty.Date pretty.POSIXt
2744
> ### Aliases: pretty.Date pretty.POSIXt
2744
> ### Keywords: dplot
2745
> ### Keywords: dplot
2745
> 
2746
> 
2746
> ### ** Examples
2747
> ### ** Examples
2747
> 
2748
> 
2748
> 
2749
> 
2749
> steps <-
2750
> steps <-
2750
+     list("10 secs", "1 min", "5 mins", "30 mins", "6 hours", "12 hours",
2751
+     list("10 secs", "1 min", "5 mins", "30 mins", "6 hours", "12 hours",
2751
+          "1 DSTday", "2 weeks", "1 month", "6 months", "1 year",
2752
+          "1 DSTday", "2 weeks", "1 month", "6 months", "1 year",
2752
+          "10 years", "50 years", "1000 years")
2753
+          "10 years", "50 years", "1000 years")
2753
> 
2754
> 
2754
> names(steps) <- paste("span =", unlist(steps))
2755
> names(steps) <- paste("span =", unlist(steps))
2755
> 
2756
> 
2756
> x <- as.POSIXct("2002-02-02 02:02")
2757
> x <- as.POSIXct("2002-02-02 02:02")
2757
> lapply(steps,
2758
> lapply(steps,
2758
+        function(s) {
2759
+        function(s) {
2759
+            at <- pretty(seq(x, by = s, length = 2), n = 5)
2760
+            at <- pretty(seq(x, by = s, length = 2), n = 5)
2760
+            attr(at, "labels")
2761
+            attr(at, "labels")
2761
+        })
2762
+        })
2762
$`span = 10 secs`
2763
$`span = 10 secs`
2763
[1] "00" "02" "04" "06" "08" "10"
2764
[1] "00" "02" "04" "06" "08" "10"
2764
 
2765
 
2765
$`span = 1 min`
2766
$`span = 1 min`
2766
[1] "00" "10" "20" "30" "40" "50" "00"
2767
[1] "00" "10" "20" "30" "40" "50" "00"
2767
 
2768
 
2768
$`span = 5 mins`
2769
$`span = 5 mins`
2769
[1] "02:02" "02:03" "02:04" "02:05" "02:06" "02:07"
2770
[1] "02:02" "02:03" "02:04" "02:05" "02:06" "02:07"
2770
 
2771
 
2771
$`span = 30 mins`
2772
$`span = 30 mins`
2772
[1] "02:05" "02:10" "02:15" "02:20" "02:25" "02:30"
2773
[1] "02:05" "02:10" "02:15" "02:20" "02:25" "02:30"
2773
 
2774
 
2774
$`span = 6 hours`
2775
$`span = 6 hours`
2775
[1] "03:00" "04:00" "05:00" "06:00" "07:00" "08:00"
2776
[1] "03:00" "04:00" "05:00" "06:00" "07:00" "08:00"
2776
 
2777
 
2777
$`span = 12 hours`
2778
$`span = 12 hours`
2778
[1] "03:00" "06:00" "09:00" "12:00"
2779
[1] "03:00" "06:00" "09:00" "12:00"
2779
 
2780
 
2780
$`span = 1 DSTday`
2781
$`span = 1 DSTday`
2781
[1] "Feb 02 06:00" "Feb 02 12:00" "Feb 02 18:00" "Feb 03 00:00"
2782
[1] "Feb 02 06:00" "Feb 02 12:00" "Feb 02 18:00" "Feb 03 00:00"
2782
 
2783
 
2783
$`span = 2 weeks`
2784
$`span = 2 weeks`
2784
[1] "Feb 04" "Feb 06" "Feb 08" "Feb 10" "Feb 12" "Feb 14" "Feb 16"
2785
[1] "Feb 04" "Feb 06" "Feb 08" "Feb 10" "Feb 12" "Feb 14" "Feb 16"
2785
 
2786
 
2786
$`span = 1 month`
2787
$`span = 1 month`
2787
[1] "Feb 04" "Feb 11" "Feb 18" "Feb 25"
2788
[1] "Feb 04" "Feb 11" "Feb 18" "Feb 25"
2788
 
2789
 
2789
$`span = 6 months`
2790
$`span = 6 months`
2790
[1] "Mar" "Apr" "May" "Jun" "Jul" "Aug"
2791
[1] "Mar" "Apr" "May" "Jun" "Jul" "Aug"
2791
 
2792
 
2792
$`span = 1 year`
2793
$`span = 1 year`
2793
[1] "Apr" "Jul" "Oct" "Jan"
2794
[1] "Apr" "Jul" "Oct" "Jan"
2794
 
2795
 
2795
$`span = 10 years`
2796
$`span = 10 years`
2796
[1] "2004" "2006" "2008" "2010" "2012"
2797
[1] "2004" "2006" "2008" "2010" "2012"
2797
 
2798
 
2798
$`span = 50 years`
2799
$`span = 50 years`
2799
[1] "2010" "2020" "2030" "2040" "2050"
2800
[1] "2010" "2020" "2030" "2040" "2050"
2800
 
2801
 
2801
$`span = 1000 years`
2802
$`span = 1000 years`
2802
[1] "2200" "2400" "2600" "2800" "3000"
2803
[1] "2200" "2400" "2600" "2800" "3000"
2803
 
2804
 
2804
> 
2805
> 
2805
> 
2806
> 
2806
> 
2807
> 
2807
> 
2808
> 
2808
> cleanEx()
2809
> cleanEx()
2809
> nameEx("ps.options")
2810
> nameEx("ps.options")
2810
> ### * ps.options
2811
> ### * ps.options
2811
> 
2812
> 
2812
> flush(stderr()); flush(stdout())
2813
> flush(stderr()); flush(stdout())
2813
> 
2814
> 
2814
> ### Name: ps.options
2815
> ### Name: ps.options
2815
> ### Title: Auxiliary Function to Set/View Defaults for Arguments of
2816
> ### Title: Auxiliary Function to Set/View Defaults for Arguments of
2816
> ###   postscript
2817
> ###   postscript
2817
> ### Aliases: ps.options setEPS setPS
2818
> ### Aliases: ps.options setEPS setPS
2818
> ### Keywords: device
2819
> ### Keywords: device
2819
> 
2820
> 
2820
> ### ** Examples
2821
> ### ** Examples
2821
> 
2822
> 
2822
> ps.options(bg = "pink")
2823
> ps.options(bg = "pink")
2823
> utils::str(ps.options())
2824
> utils::str(ps.options())
2824
List of 18
2825
List of 18
2825
 $ onefile    : logi TRUE
2826
 $ onefile    : logi TRUE
2826
 $ family     : chr "Helvetica"
2827
 $ family     : chr "Helvetica"
2827
 $ title      : chr "R Graphics Output"
2828
 $ title      : chr "R Graphics Output"
2828
 $ fonts      : NULL
2829
 $ fonts      : NULL
2829
 $ encoding   : chr "default"
2830
 $ encoding   : chr "default"
2830
 $ bg         : chr "pink"
2831
 $ bg         : chr "pink"
2831
 $ fg         : chr "black"
2832
 $ fg         : chr "black"
2832
 $ width      : num 7
2833
 $ width      : num 7
2833
 $ height     : num 7
2834
 $ height     : num 7
2834
 $ horizontal : logi TRUE
2835
 $ horizontal : logi TRUE
2835
 $ pointsize  : num 12
2836
 $ pointsize  : num 12
2836
 $ paper      : chr "a4"
2837
 $ paper      : chr "a4"
2837
 $ pagecentre : logi TRUE
2838
 $ pagecentre : logi TRUE
2838
 $ print.it   : logi FALSE
2839
 $ print.it   : logi FALSE
2839
 $ command    : chr "default"
2840
 $ command    : chr "default"
2840
 $ colormodel : chr "rgb"
2841
 $ colormodel : chr "rgb"
2841
 $ useKerning : logi TRUE
2842
 $ useKerning : logi TRUE
2842
 $ fillOddEven: logi FALSE
2843
 $ fillOddEven: logi FALSE
2843
> 
2844
> 
2844
> ### ---- error checking of arguments: ----
2845
> ### ---- error checking of arguments: ----
2845
> ps.options(width=0:12, onefile=0, bg=pi)
2846
> ps.options(width=0:12, onefile=0, bg=pi)
2846
Warning: 'mode(onefile)' and 'mode(bg)' differ between new and previous
2847
Warning: 'mode(onefile)' and 'mode(bg)' differ between new and previous
2847
	 ==> NOT changing 'onefile' & 'bg'
2848
	 ==> NOT changing 'onefile' & 'bg'
2848
Warning: 'length(width)' differs between new and previous
2849
Warning: 'length(width)' differs between new and previous
2849
	 ==> NOT changing 'width'
2850
	 ==> NOT changing 'width'
2850
> # override the check for 'width', but not 'bg':
2851
> # override the check for 'width', but not 'bg':
2851
> ps.options(width=0:12, bg=pi, override.check = c(TRUE,FALSE))
2852
> ps.options(width=0:12, bg=pi, override.check = c(TRUE,FALSE))
2852
Warning: 'mode(bg)' differs between new and previous
2853
Warning: 'mode(bg)' differs between new and previous
2853
	 ==> NOT changing 'bg'
2854
	 ==> NOT changing 'bg'
2854
Warning: 'length(width)' differs between new and previous
2855
Warning: 'length(width)' differs between new and previous
2855
> utils::str(ps.options())
2856
> utils::str(ps.options())
2856
List of 18
2857
List of 18
2857
 $ onefile    : logi TRUE
2858
 $ onefile    : logi TRUE
2858
 $ family     : chr "Helvetica"
2859
 $ family     : chr "Helvetica"
2859
 $ title      : chr "R Graphics Output"
2860
 $ title      : chr "R Graphics Output"
2860
 $ fonts      : NULL
2861
 $ fonts      : NULL
2861
 $ encoding   : chr "default"
2862
 $ encoding   : chr "default"
2862
 $ bg         : chr "pink"
2863
 $ bg         : chr "pink"
2863
 $ fg         : chr "black"
2864
 $ fg         : chr "black"
2864
 $ width      : int [1:13] 0 1 2 3 4 5 6 7 8 9 ...
2865
 $ width      : int [1:13] 0 1 2 3 4 5 6 7 8 9 ...
2865
 $ height     : num 7
2866
 $ height     : num 7
2866
 $ horizontal : logi TRUE
2867
 $ horizontal : logi TRUE
2867
 $ pointsize  : num 12
2868
 $ pointsize  : num 12
2868
 $ paper      : chr "a4"
2869
 $ paper      : chr "a4"
2869
 $ pagecentre : logi TRUE
2870
 $ pagecentre : logi TRUE
2870
 $ print.it   : logi FALSE
2871
 $ print.it   : logi FALSE
2871
 $ command    : chr "default"
2872
 $ command    : chr "default"
2872
 $ colormodel : chr "rgb"
2873
 $ colormodel : chr "rgb"
2873
 $ useKerning : logi TRUE
2874
 $ useKerning : logi TRUE
2874
 $ fillOddEven: logi FALSE
2875
 $ fillOddEven: logi FALSE
2875
> ps.options(reset = TRUE) # back to factory-fresh
2876
> ps.options(reset = TRUE) # back to factory-fresh
2876
> 
2877
> 
2877
> 
2878
> 
2878
> 
2879
> 
2879
> cleanEx()
2880
> cleanEx()
2880
> nameEx("recordGraphics")
2881
> nameEx("recordGraphics")
2881
> ### * recordGraphics
2882
> ### * recordGraphics
2882
> 
2883
> 
2883
> flush(stderr()); flush(stdout())
2884
> flush(stderr()); flush(stdout())
2884
> 
2885
> 
2885
> ### Name: recordGraphics
2886
> ### Name: recordGraphics
2886
> ### Title: Record Graphics Operations
2887
> ### Title: Record Graphics Operations
2887
> ### Aliases: recordGraphics
2888
> ### Aliases: recordGraphics
2888
> ### Keywords: device
2889
> ### Keywords: device
2889
> 
2890
> 
2890
> ### ** Examples
2891
> ### ** Examples
2891
> 
2892
> 
2892
> require(graphics)
2893
> require(graphics)
2893
> 
2894
> 
2894
> plot(1:10)
2895
> plot(1:10)
2895
> # This rectangle remains 1inch wide when the device is resized
2896
> # This rectangle remains 1inch wide when the device is resized
2896
> recordGraphics(
2897
> recordGraphics(
2897
+   {
2898
+   {
2898
+     rect(4, 2,
2899
+     rect(4, 2,
2899
+          4 + diff(par("usr")[1:2])/par("pin")[1], 3)
2900
+          4 + diff(par("usr")[1:2])/par("pin")[1], 3)
2900
+   },
2901
+   },
2901
+   list(),
2902
+   list(),
2902
+   getNamespace("graphics"))
2903
+   getNamespace("graphics"))
2903
> 
2904
> 
2904
> 
2905
> 
2905
> 
2906
> 
2906
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
2907
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
2907
> cleanEx()
2908
> cleanEx()
2908
> nameEx("rgb")
2909
> nameEx("rgb")
2909
> ### * rgb
2910
> ### * rgb
2910
> 
2911
> 
2911
> flush(stderr()); flush(stdout())
2912
> flush(stderr()); flush(stdout())
2912
> 
2913
> 
2913
> ### Name: rgb
2914
> ### Name: rgb
2914
> ### Title: RGB Color Specification
2915
> ### Title: RGB Color Specification
2915
> ### Aliases: rgb
2916
> ### Aliases: rgb
2916
> ### Keywords: color
2917
> ### Keywords: color
2917
> 
2918
> 
2918
> ### ** Examples
2919
> ### ** Examples
2919
> 
2920
> 
2920
> rgb(0,1,0)
2921
> rgb(0,1,0)
2921
[1] "#00FF00"
2922
[1] "#00FF00"
2922
> 
2923
> 
2923
> rgb((0:15)/15, green=0, blue=0, names=paste("red",0:15,sep="."))
2924
> rgb((0:15)/15, green=0, blue=0, names=paste("red",0:15,sep="."))
2924
    red.0     red.1     red.2     red.3     red.4     red.5     red.6     red.7 
2925
    red.0     red.1     red.2     red.3     red.4     red.5     red.6     red.7 
2925
"#000000" "#110000" "#220000" "#330000" "#440000" "#550000" "#660000" "#770000" 
2926
"#000000" "#110000" "#220000" "#330000" "#440000" "#550000" "#660000" "#770000" 
2926
    red.8     red.9    red.10    red.11    red.12    red.13    red.14    red.15 
2927
    red.8     red.9    red.10    red.11    red.12    red.13    red.14    red.15 
2927
"#880000" "#990000" "#AA0000" "#BB0000" "#CC0000" "#DD0000" "#EE0000" "#FF0000" 
2928
"#880000" "#990000" "#AA0000" "#BB0000" "#CC0000" "#DD0000" "#EE0000" "#FF0000" 
2928
> 
2929
> 
2929
> rgb(0, 0:12, 0, max = 255)# integer input
2930
> rgb(0, 0:12, 0, max = 255)# integer input
2930
 [1] "#000000" "#000100" "#000200" "#000300" "#000400" "#000500" "#000600"
2931
 [1] "#000000" "#000100" "#000200" "#000300" "#000400" "#000500" "#000600"
2931
 [8] "#000700" "#000800" "#000900" "#000A00" "#000B00" "#000C00"
2932
 [8] "#000700" "#000800" "#000900" "#000A00" "#000B00" "#000C00"
2932
> 
2933
> 
2933
> ramp <- colorRamp(c("red", "white"))
2934
> ramp <- colorRamp(c("red", "white"))
2934
> rgb( ramp(seq(0, 1, length = 5)), max = 255)
2935
> rgb( ramp(seq(0, 1, length = 5)), max = 255)
2935
[1] "#FF0000" "#FF3F3F" "#FF7F7F" "#FFBFBF" "#FFFFFF"
2936
[1] "#FF0000" "#FF3F3F" "#FF7F7F" "#FFBFBF" "#FFFFFF"
2936
> 
2937
> 
2937
> 
2938
> 
2938
> 
2939
> 
2939
> cleanEx()
2940
> cleanEx()
2940
> nameEx("rgb2hsv")
2941
> nameEx("rgb2hsv")
2941
> ### * rgb2hsv
2942
> ### * rgb2hsv
2942
> 
2943
> 
2943
> flush(stderr()); flush(stdout())
2944
> flush(stderr()); flush(stdout())
2944
> 
2945
> 
2945
> ### Name: rgb2hsv
2946
> ### Name: rgb2hsv
2946
> ### Title: RGB to HSV Conversion
2947
> ### Title: RGB to HSV Conversion
2947
> ### Aliases: rgb2hsv
2948
> ### Aliases: rgb2hsv
2948
> ### Keywords: color dplot
2949
> ### Keywords: color dplot
2949
> 
2950
> 
2950
> ### ** Examples
2951
> ### ** Examples
2951
> 
2952
> 
2952
> ## These (saturated, bright ones) only differ by hue
2953
> ## These (saturated, bright ones) only differ by hue
2953
> (rc <- col2rgb(c("red", "yellow","green","cyan", "blue", "magenta")))
2954
> (rc <- col2rgb(c("red", "yellow","green","cyan", "blue", "magenta")))
2954
      [,1] [,2] [,3] [,4] [,5] [,6]
2955
      [,1] [,2] [,3] [,4] [,5] [,6]
2955
red    255  255    0    0    0  255
2956
red    255  255    0    0    0  255
2956
green    0  255  255  255    0    0
2957
green    0  255  255  255    0    0
2957
blue     0    0    0  255  255  255
2958
blue     0    0    0  255  255  255
2958
> (hc <- rgb2hsv(rc))
2959
> (hc <- rgb2hsv(rc))
2959
  [,1]      [,2]      [,3] [,4]      [,5]      [,6]
2960
  [,1]      [,2]      [,3] [,4]      [,5]      [,6]
2960
h    0 0.1666667 0.3333333  0.5 0.6666667 0.8333333
2961
h    0 0.1666667 0.3333333  0.5 0.6666667 0.8333333
2961
s    1 1.0000000 1.0000000  1.0 1.0000000 1.0000000
2962
s    1 1.0000000 1.0000000  1.0 1.0000000 1.0000000
2962
v    1 1.0000000 1.0000000  1.0 1.0000000 1.0000000
2963
v    1 1.0000000 1.0000000  1.0 1.0000000 1.0000000
2963
> 6 * hc["h",] # the hues are equispaced
2964
> 6 * hc["h",] # the hues are equispaced
2964
[1] 0 1 2 3 4 5
2965
[1] 0 1 2 3 4 5
2965
> 
2966
> 
2966
> ## Don't show: 
2967
> ## Don't show: 
2967
> set.seed(151)
2968
> set.seed(151)
2968
> ## End Don't show
2969
> ## End Don't show
2969
> (rgb3 <- floor(256 * matrix(stats::runif(3*12), 3,12)))
2970
> (rgb3 <- floor(256 * matrix(stats::runif(3*12), 3,12)))
2970
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
2971
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
2971
[1,]  122  137  116  244   20  153  191  250  134   117    27   202
2972
[1,]  122  137  116  244   20  153  191  250  134   117    27   202
2972
[2,]  221  113  210  200  218  151   64  182  195   103   218   254
2973
[2,]  221  113  210  200  218  151   64  182  195   103   218   254
2973
[3,]  199  157   88   76   39   91   80  146   22   105    17   239
2974
[3,]  199  157   88   76   39   91   80  146   22   105    17   239
2974
> (hsv3 <- rgb2hsv(rgb3))
2975
> (hsv3 <- rgb2hsv(rgb3))
2975
       [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
2976
       [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7]
2976
h 0.4629630 0.7575758 0.2950820 0.1230159 0.3493266 0.1612903 0.9790026
2977
h 0.4629630 0.7575758 0.2950820 0.1230159 0.3493266 0.1612903 0.9790026
2977
s 0.4479638 0.2802548 0.5809524 0.6885246 0.9082569 0.4052288 0.6649215
2978
s 0.4479638 0.2802548 0.5809524 0.6885246 0.9082569 0.4052288 0.6649215
2978
v 0.8666667 0.6156863 0.8235294 0.9568627 0.8549020 0.6000000 0.7490196
2979
v 0.8666667 0.6156863 0.8235294 0.9568627 0.8549020 0.6000000 0.7490196
2979
        [,8]      [,9]     [,10]     [,11]     [,12]
2980
        [,8]      [,9]     [,10]     [,11]     [,12]
2980
h 0.05769231 0.2254335 0.9761905 0.3250415 0.4519231
2981
h 0.05769231 0.2254335 0.9761905 0.3250415 0.4519231
2981
s 0.41600000 0.8871795 0.1196581 0.9220183 0.2047244
2982
s 0.41600000 0.8871795 0.1196581 0.9220183 0.2047244
2982
v 0.98039216 0.7647059 0.4588235 0.8549020 0.9960784
2983
v 0.98039216 0.7647059 0.4588235 0.8549020 0.9960784
2983
> ## Consistency :
2984
> ## Consistency :
2984
> stopifnot(rgb3 == col2rgb(hsv(h=hsv3[1,], s=hsv3[2,], v=hsv3[3,])),
2985
> stopifnot(rgb3 == col2rgb(hsv(h=hsv3[1,], s=hsv3[2,], v=hsv3[3,])),
2985
+           all.equal(hsv3, rgb2hsv(rgb3/255, maxColorValue = 1)))
2986
+           all.equal(hsv3, rgb2hsv(rgb3/255, maxColorValue = 1)))
2986
> 
2987
> 
2987
> ## A (simplified) pure R version -- originally by Wolfram Fischer --
2988
> ## A (simplified) pure R version -- originally by Wolfram Fischer --
2988
> ## showing the exact algorithm:
2989
> ## showing the exact algorithm:
2989
> rgb2hsvR <- function(rgb, gamma = 1, maxColorValue = 255)
2990
> rgb2hsvR <- function(rgb, gamma = 1, maxColorValue = 255)
2990
+ {
2991
+ {
2991
+     if(!is.numeric(rgb)) stop("rgb matrix must be numeric")
2992
+     if(!is.numeric(rgb)) stop("rgb matrix must be numeric")
2992
+     d <- dim(rgb)
2993
+     d <- dim(rgb)
2993
+     if(d[1] != 3) stop("rgb matrix must have 3 rows")
2994
+     if(d[1] != 3) stop("rgb matrix must have 3 rows")
2994
+     n <- d[2]
2995
+     n <- d[2]
2995
+     if(n == 0) return(cbind(c(h=1,s=1,v=1))[,0])
2996
+     if(n == 0) return(cbind(c(h=1,s=1,v=1))[,0])
2996
+     rgb <- rgb/maxColorValue
2997
+     rgb <- rgb/maxColorValue
2997
+     if(gamma != 1) rgb <- rgb ^ (1/gamma)
2998
+     if(gamma != 1) rgb <- rgb ^ (1/gamma)
2998
+ 
2999
+ 
2999
+     ## get the max and min
3000
+     ## get the max and min
3000
+     v <- apply( rgb, 2, max)
3001
+     v <- apply( rgb, 2, max)
3001
+     s <- apply( rgb, 2, min)
3002
+     s <- apply( rgb, 2, min)
3002
+     D <- v - s # range
3003
+     D <- v - s # range
3003
+ 
3004
+ 
3004
+     ## set hue to zero for undefined values (gray has no hue)
3005
+     ## set hue to zero for undefined values (gray has no hue)
3005
+     h <- numeric(n)
3006
+     h <- numeric(n)
3006
+     notgray <- ( s != v )
3007
+     notgray <- ( s != v )
3007
+ 
3008
+ 
3008
+     ## blue hue
3009
+     ## blue hue
3009
+     idx <- (v == rgb[3,] & notgray )
3010
+     idx <- (v == rgb[3,] & notgray )
3010
+     if (any (idx))
3011
+     if (any (idx))
3011
+         h[idx] <- 2/3 + 1/6 * (rgb[1,idx] - rgb[2,idx]) / D[idx]
3012
+         h[idx] <- 2/3 + 1/6 * (rgb[1,idx] - rgb[2,idx]) / D[idx]
3012
+     ## green hue
3013
+     ## green hue
3013
+     idx <- (v == rgb[2,] & notgray )
3014
+     idx <- (v == rgb[2,] & notgray )
3014
+     if (any (idx))
3015
+     if (any (idx))
3015
+         h[idx] <- 1/3 + 1/6 * (rgb[3,idx] - rgb[1,idx]) / D[idx]
3016
+         h[idx] <- 1/3 + 1/6 * (rgb[3,idx] - rgb[1,idx]) / D[idx]
3016
+     ## red hue
3017
+     ## red hue
3017
+     idx <- (v == rgb[1,] & notgray )
3018
+     idx <- (v == rgb[1,] & notgray )
3018
+     if (any (idx))
3019
+     if (any (idx))
3019
+         h[idx] <-       1/6 * (rgb[2,idx] - rgb[3,idx]) / D[idx]
3020
+         h[idx] <-       1/6 * (rgb[2,idx] - rgb[3,idx]) / D[idx]
3020
+ 
3021
+ 
3021
+     ## correct for negative red
3022
+     ## correct for negative red
3022
+     idx <- (h < 0)
3023
+     idx <- (h < 0)
3023
+     h[idx] <- 1+h[idx]
3024
+     h[idx] <- 1+h[idx]
3024
+ 
3025
+ 
3025
+     ## set the saturation
3026
+     ## set the saturation
3026
+     s[! notgray] <- 0;
3027
+     s[! notgray] <- 0;
3027
+     s[notgray] <- 1 - s[notgray] / v[notgray]
3028
+     s[notgray] <- 1 - s[notgray] / v[notgray]
3028
+ 
3029
+ 
3029
+     rbind( h=h, s=s, v=v )
3030
+     rbind( h=h, s=s, v=v )
3030
+ }
3031
+ }
3031
> 
3032
> 
3032
> ## confirm the equivalence:
3033
> ## confirm the equivalence:
3033
> all.equal(rgb2hsv (rgb3),
3034
> all.equal(rgb2hsv (rgb3),
3034
+           rgb2hsvR(rgb3), tol=1e-14) # TRUE
3035
+           rgb2hsvR(rgb3), tol=1e-14) # TRUE
3035
[1] TRUE
3036
[1] TRUE
3036
> 
3037
> 
3037
> 
3038
> 
3038
> 
3039
> 
3039
> cleanEx()
3040
> cleanEx()
3040
> nameEx("trans3d")
3041
> nameEx("trans3d")
3041
> ### * trans3d
3042
> ### * trans3d
3042
> 
3043
> 
3043
> flush(stderr()); flush(stdout())
3044
> flush(stderr()); flush(stdout())
3044
> 
3045
> 
3045
> ### Name: trans3d
3046
> ### Name: trans3d
3046
> ### Title: 3D to 2D Transformation for Perspective Plots
3047
> ### Title: 3D to 2D Transformation for Perspective Plots
3047
> ### Aliases: trans3d
3048
> ### Aliases: trans3d
3048
> ### Keywords: dplot
3049
> ### Keywords: dplot
3049
> 
3050
> 
3050
> ### ** Examples
3051
> ### ** Examples
3051
> 
3052
> 
3052
> ## See  help(persp) {after attaching the 'graphics' package}
3053
> ## See  help(persp) {after attaching the 'graphics' package}
3053
> ##      -----------
3054
> ##      -----------
3054
> 
3055
> 
3055
> 
3056
> 
3056
> 
3057
> 
3057
> cleanEx()
3058
> cleanEx()
3058
> nameEx("xy.coords")
3059
> nameEx("xy.coords")
3059
> ### * xy.coords
3060
> ### * xy.coords
3060
> 
3061
> 
3061
> flush(stderr()); flush(stdout())
3062
> flush(stderr()); flush(stdout())
3062
> 
3063
> 
3063
> ### Name: xy.coords
3064
> ### Name: xy.coords
3064
> ### Title: Extracting Plotting Structures
3065
> ### Title: Extracting Plotting Structures
3065
> ### Aliases: xy.coords
3066
> ### Aliases: xy.coords
3066
> ### Keywords: dplot
3067
> ### Keywords: dplot
3067
> 
3068
> 
3068
> ### ** Examples
3069
> ### ** Examples
3069
> 
3070
> 
3070
> xy.coords(stats::fft(c(1:9)), NULL)
3071
> xy.coords(stats::fft(c(1:9)), NULL)
3071
$x
3072
$x
3072
[1] 45.0 -4.5 -4.5 -4.5 -4.5 -4.5 -4.5 -4.5 -4.5
3073
[1] 45.0 -4.5 -4.5 -4.5 -4.5 -4.5 -4.5 -4.5 -4.5
3073
 
3074
 
3074
$y
3075
$y
3075
[1]   0.0000000  12.3636484   5.3628912   2.5980762   0.7934714  -0.7934714
3076
[1]   0.0000000  12.3636484   5.3628912   2.5980762   0.7934714  -0.7934714
3076
[7]  -2.5980762  -5.3628912 -12.3636484
3077
[7]  -2.5980762  -5.3628912 -12.3636484
3077
 
3078
 
3078
$xlab
3079
$xlab
3079
[1] "Re()"
3080
[1] "Re()"
3080
 
3081
 
3081
$ylab
3082
$ylab
3082
[1] "Im()"
3083
[1] "Im()"
3083
 
3084
 
3084
> 
3085
> 
3085
> with(cars, xy.coords(dist ~ speed, NULL)$xlab ) # = "speed"
3086
> with(cars, xy.coords(dist ~ speed, NULL)$xlab ) # = "speed"
3086
[1] "speed"
3087
[1] "speed"
3087
> 
3088
> 
3088
> xy.coords(1:3, 1:2, recycle=TRUE)
3089
> xy.coords(1:3, 1:2, recycle=TRUE)
3089
$x
3090
$x
3090
[1] 1 2 3
3091
[1] 1 2 3
3091
 
3092
 
3092
$y
3093
$y
3093
[1] 1 2 1
3094
[1] 1 2 1
3094
 
3095
 
3095
$xlab
3096
$xlab
3096
NULL
3097
NULL
3097
 
3098
 
3098
$ylab
3099
$ylab
3099
NULL
3100
NULL
3100
 
3101
 
3101
> xy.coords(-2:10,NULL, log="y")
3102
> xy.coords(-2:10,NULL, log="y")
3102
Warning in xy.coords(-2:10, NULL, log = "y") :
3103
Warning in xy.coords(-2:10, NULL, log = "y") :
3103
  3 y values <= 0 omitted from logarithmic plot
3104
  3 y values <= 0 omitted from logarithmic plot
3104
$x
3105
$x
3105
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13
3106
 [1]  1  2  3  4  5  6  7  8  9 10 11 12 13
3106
 
3107
 
3107
$y
3108
$y
3108
 [1] NA NA NA  1  2  3  4  5  6  7  8  9 10
3109
 [1] NA NA NA  1  2  3  4  5  6  7  8  9 10
3109
 
3110
 
3110
$xlab
3111
$xlab
3111
[1] "Index"
3112
[1] "Index"
3112
 
3113
 
3113
$ylab
3114
$ylab
3114
NULL
3115
NULL
3115
 
3116
 
3116
> ##> warning: 3 y values <=0 omitted ..
3117
> ##> warning: 3 y values <=0 omitted ..
3117
> 
3118
> 
3118
> 
3119
> 
3119
> 
3120
> 
3120
> cleanEx()
3121
> cleanEx()
3121
> nameEx("xyTable")
3122
> nameEx("xyTable")
3122
> ### * xyTable
3123
> ### * xyTable
3123
> 
3124
> 
3124
> flush(stderr()); flush(stdout())
3125
> flush(stderr()); flush(stdout())
3125
> 
3126
> 
3126
> ### Name: xyTable
3127
> ### Name: xyTable
3127
> ### Title: Multiplicities of (x,y) Points, e.g., for a Sunflower Plot
3128
> ### Title: Multiplicities of (x,y) Points, e.g., for a Sunflower Plot
3128
> ### Aliases: xyTable
3129
> ### Aliases: xyTable
3129
> ### Keywords: dplot
3130
> ### Keywords: dplot
3130
> 
3131
> 
3131
> ### ** Examples
3132
> ### ** Examples
3132
> 
3133
> 
3133
> xyTable(iris[,3:4], digits = 6)
3134
> xyTable(iris[,3:4], digits = 6)
3134
$x
3135
$x
3135
  [1] 1.0 1.1 1.2 1.3 1.3 1.3 1.4 1.4 1.4 1.5 1.5 1.5 1.5 1.6 1.6 1.6 1.7 1.7
3136
  [1] 1.0 1.1 1.2 1.3 1.3 1.3 1.4 1.4 1.4 1.5 1.5 1.5 1.5 1.6 1.6 1.6 1.7 1.7
3136
 [19] 1.7 1.7 1.9 1.9 3.0 3.3 3.5 3.6 3.7 3.8 3.9 3.9 3.9 4.0 4.0 4.0 4.1 4.1
3137
 [19] 1.7 1.7 1.9 1.9 3.0 3.3 3.5 3.6 3.7 3.8 3.9 3.9 3.9 4.0 4.0 4.0 4.1 4.1
3137
 [37] 4.2 4.2 4.2 4.3 4.4 4.4 4.4 4.5 4.5 4.5 4.5 4.6 4.6 4.6 4.7 4.7 4.7 4.7
3138
 [37] 4.2 4.2 4.2 4.3 4.4 4.4 4.4 4.5 4.5 4.5 4.5 4.6 4.6 4.6 4.7 4.7 4.7 4.7
3138
 [55] 4.8 4.8 4.9 4.9 4.9 5.0 5.0 5.0 5.0 5.1 5.1 5.1 5.1 5.1 5.1 5.1 5.2 5.2
3139
 [55] 4.8 4.8 4.9 4.9 4.9 5.0 5.0 5.0 5.0 5.1 5.1 5.1 5.1 5.1 5.1 5.1 5.2 5.2
3139
 [73] 5.3 5.3 5.4 5.4 5.5 5.5 5.6 5.6 5.6 5.6 5.6 5.7 5.7 5.7 5.8 5.8 5.8 5.9
3140
 [73] 5.3 5.3 5.4 5.4 5.5 5.5 5.6 5.6 5.6 5.6 5.6 5.7 5.7 5.7 5.8 5.8 5.8 5.9
3140
 [91] 5.9 6.0 6.0 6.1 6.1 6.1 6.3 6.4 6.6 6.7 6.7 6.9
3141
 [91] 5.9 6.0 6.0 6.1 6.1 6.1 6.3 6.4 6.6 6.7 6.7 6.9
3141
 
3142
 
3142
$y
3143
$y
3143
  [1] 0.2 0.1 0.2 0.2 0.3 0.4 0.1 0.2 0.3 0.1 0.2 0.3 0.4 0.2 0.4 0.6 0.2 0.3
3144
  [1] 0.2 0.1 0.2 0.2 0.3 0.4 0.1 0.2 0.3 0.1 0.2 0.3 0.4 0.2 0.4 0.6 0.2 0.3
3144
 [19] 0.4 0.5 0.2 0.4 1.1 1.0 1.0 1.3 1.0 1.1 1.1 1.2 1.4 1.0 1.2 1.3 1.0 1.3
3145
 [19] 0.4 0.5 0.2 0.4 1.1 1.0 1.0 1.3 1.0 1.1 1.1 1.2 1.4 1.0 1.2 1.3 1.0 1.3
3145
 [37] 1.2 1.3 1.5 1.3 1.2 1.3 1.4 1.3 1.5 1.6 1.7 1.3 1.4 1.5 1.2 1.4 1.5 1.6
3146
 [37] 1.2 1.3 1.5 1.3 1.2 1.3 1.4 1.3 1.5 1.6 1.7 1.3 1.4 1.5 1.2 1.4 1.5 1.6
3146
 [55] 1.4 1.8 1.5 1.8 2.0 1.5 1.7 1.9 2.0 1.5 1.6 1.8 1.9 2.0 2.3 2.4 2.0 2.3
3147
 [55] 1.4 1.8 1.5 1.8 2.0 1.5 1.7 1.9 2.0 1.5 1.6 1.8 1.9 2.0 2.3 2.4 2.0 2.3
3147
 [73] 1.9 2.3 2.1 2.3 1.8 2.1 1.4 1.8 2.1 2.2 2.4 2.1 2.3 2.5 1.6 1.8 2.2 2.1
3148
 [73] 1.9 2.3 2.1 2.3 1.8 2.1 1.4 1.8 2.1 2.2 2.4 2.1 2.3 2.5 1.6 1.8 2.2 2.1
3148
 [91] 2.3 1.8 2.5 1.9 2.3 2.5 1.8 2.0 2.1 2.0 2.2 2.3
3149
 [91] 2.3 1.8 2.5 1.9 2.3 2.5 1.8 2.0 2.1 2.0 2.2 2.3
3149
 
3150
 
3150
$number
3151
$number
3151
  [1] 1 1 2 4 2 1 2 8 3 2 7 1 3 5 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 3 1 2 1
3152
  [1] 1 1 2 4 2 1 2 8 3 2 7 1 3 5 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 3 1 2 1
3152
 [38] 2 1 2 1 1 2 1 5 1 1 1 1 1 1 2 1 1 1 3 2 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1
3153
 [38] 2 1 2 1 1 2 1 5 1 1 1 1 1 1 2 1 1 1 3 2 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1
3153
 [75] 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3154
 [75] 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3154
 
3155
 
3155
> 
3156
> 
3156
> ## Discretized uncorrelated Gaussian:
3157
> ## Discretized uncorrelated Gaussian:
3157
> ## Don't show: 
3158
> ## Don't show: 
3158
> set.seed(1)
3159
> set.seed(1)
3159
> ## End Don't show
3160
> ## End Don't show
3160
> require(stats)
3161
> require(stats)
3161
> xy <- data.frame(x = round(sort(rnorm(100))), y = rnorm(100))
3162
> xy <- data.frame(x = round(sort(rnorm(100))), y = rnorm(100))
3162
> xyTable(xy, digits = 1)
3163
> xyTable(xy, digits = 1)
3163
$x
3164
$x
3164
 [1] -2 -2 -2 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1  0  0  0  0  0  0  0  0
3165
 [1] -2 -2 -2 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1  0  0  0  0  0  0  0  0
3165
[26]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1  1  1  1  1  1  1  1  1  1
3166
[26]  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1  1  1  1  1  1  1  1  1  1
3166
[51]  1  1  1  1  1  1  2  2  2  2
3167
[51]  1  1  1  1  1  1  2  2  2  2
3167
 
3168
 
3168
$y
3169
$y
3169
 [1] -0.90 -0.60  0.04  0.20 -0.70 -0.60 -0.50 -0.40 -0.30 -0.20 -0.10  0.40
3170
 [1] -0.90 -0.60  0.04  0.20 -0.70 -0.60 -0.50 -0.40 -0.30 -0.20 -0.10  0.40
3170
[13]  0.50  0.70  0.90  1.00  2.00 -2.00 -1.00 -0.90 -0.80 -0.70 -0.60 -0.50
3171
[13]  0.50  0.70  0.90  1.00  2.00 -2.00 -1.00 -0.90 -0.80 -0.70 -0.60 -0.50
3171
[25] -0.30 -0.20 -0.07 -0.06 -0.04 -0.02  0.02  0.06  0.30  0.40  0.50  0.70
3172
[25] -0.30 -0.20 -0.07 -0.06 -0.04 -0.02  0.02  0.06  0.30  0.40  0.50  0.70
3172
[37]  0.90  1.00  2.00 -1.00 -0.90 -0.80 -0.70 -0.40 -0.30 -0.20 -0.10 -0.08
3173
[37]  0.90  1.00  2.00 -1.00 -0.90 -0.80 -0.70 -0.40 -0.30 -0.20 -0.10 -0.08
3173
[49] -0.03  0.10  0.20  0.40  0.50  0.80  1.00  2.00 -1.00 -0.40  0.40  1.00
3174
[49] -0.03  0.10  0.20  0.40  0.50  0.80  1.00  2.00 -1.00 -0.40  0.40  1.00
3174
 
3175
 
3175
$number
3176
$number
3176
 [1] 1 1 1 1 2 1 2 1 2 4 1 1 1 1 1 2 2 5 5 1 1 2 3 2 3 1 1 1 1 1 1 1 1 1 2 1 1 3
3177
 [1] 1 1 1 1 2 1 2 1 2 4 1 1 1 1 1 2 2 5 5 1 1 2 3 2 3 1 1 1 1 1 1 1 1 1 2 1 1 3
3177
[39] 3 3 1 1 1 1 2 2 1 1 1 1 2 1 2 2 4 2 3 1 1 1
3178
[39] 3 3 1 1 1 1 2 2 1 1 1 1 2 1 2 2 4 2 3 1 1 1
3178
 
3179
 
3179
> 
3180
> 
3180
> 
3181
> 
3181
> 
3182
> 
3182
> cleanEx()
3183
> cleanEx()
3183
> nameEx("xyz.coords")
3184
> nameEx("xyz.coords")
3184
> ### * xyz.coords
3185
> ### * xyz.coords
3185
> 
3186
> 
3186
> flush(stderr()); flush(stdout())
3187
> flush(stderr()); flush(stdout())
3187
> 
3188
> 
3188
> ### Name: xyz.coords
3189
> ### Name: xyz.coords
3189
> ### Title: Extracting Plotting Structures
3190
> ### Title: Extracting Plotting Structures
3190
> ### Aliases: xyz.coords
3191
> ### Aliases: xyz.coords
3191
> ### Keywords: dplot
3192
> ### Keywords: dplot
3192
> 
3193
> 
3193
> ### ** Examples
3194
> ### ** Examples
3194
> 
3195
> 
3195
> xyz.coords(data.frame(10*1:9, -4), y = NULL, z = NULL)
3196
> xyz.coords(data.frame(10*1:9, -4), y = NULL, z = NULL)
3196
$x
3197
$x
3197
[1] 1 2 3 4 5 6 7 8 9
3198
[1] 1 2 3 4 5 6 7 8 9
3198
 
3199
 
3199
$y
3200
$y
3200
[1] 10 20 30 40 50 60 70 80 90
3201
[1] 10 20 30 40 50 60 70 80 90
3201
 
3202
 
3202
$z
3203
$z
3203
[1] -4 -4 -4 -4 -4 -4 -4 -4 -4
3204
[1] -4 -4 -4 -4 -4 -4 -4 -4 -4
3204
 
3205
 
3205
$xlab
3206
$xlab
3206
[1] "Index"
3207
[1] "Index"
3207
 
3208
 
3208
$ylab
3209
$ylab
3209
NULL
3210
NULL
3210
 
3211
 
3211
$zlab
3212
$zlab
3212
NULL
3213
NULL
3213
 
3214
 
3214
> 
3215
> 
3215
> xyz.coords(1:5, stats::fft(1:5), z = NULL, xlab = "X", ylab = "Y")
3216
> xyz.coords(1:5, stats::fft(1:5), z = NULL, xlab = "X", ylab = "Y")
3216
$x
3217
$x
3217
[1] 15.0 -2.5 -2.5 -2.5 -2.5
3218
[1] 15.0 -2.5 -2.5 -2.5 -2.5
3218
 
3219
 
3219
$y
3220
$y
3220
[1]  0.0000000  3.4409548  0.8122992 -0.8122992 -3.4409548
3221
[1]  0.0000000  3.4409548  0.8122992 -0.8122992 -3.4409548
3221
 
3222
 
3222
$z
3223
$z
3223
[1] 1 2 3 4 5
3224
[1] 1 2 3 4 5
3224
 
3225
 
3225
$xlab
3226
$xlab
3226
[1] "Re(Y)"
3227
[1] "Re(Y)"
3227
 
3228
 
3228
$ylab
3229
$ylab
3229
[1] "Im(Y)"
3230
[1] "Im(Y)"
3230
 
3231
 
3231
$zlab
3232
$zlab
3232
[1] "X"
3233
[1] "X"
3233
 
3234
 
3234
> 
3235
> 
3235
> y <- 2 * (x2 <- 10 + (x1 <- 1:10))
3236
> y <- 2 * (x2 <- 10 + (x1 <- 1:10))
3236
> xyz.coords(y ~ x1 + x2, y = NULL, z = NULL)
3237
> xyz.coords(y ~ x1 + x2, y = NULL, z = NULL)
3237
$x
3238
$x
3238
 [1]  1  2  3  4  5  6  7  8  9 10
3239
 [1]  1  2  3  4  5  6  7  8  9 10
3239
 
3240
 
3240
$y
3241
$y
3241
 [1] 11 12 13 14 15 16 17 18 19 20
3242
 [1] 11 12 13 14 15 16 17 18 19 20
3242
 
3243
 
3243
$z
3244
$z
3244
 [1] 22 24 26 28 30 32 34 36 38 40
3245
 [1] 22 24 26 28 30 32 34 36 38 40
3245
 
3246
 
3246
$xlab
3247
$xlab
3247
[1] "x1"
3248
[1] "x1"
3248
 
3249
 
3249
$ylab
3250
$ylab
3250
[1] "x2"
3251
[1] "x2"
3251
 
3252
 
3252
$zlab
3253
$zlab
3253
[1] "y"
3254
[1] "y"
3254
 
3255
 
3255
> 
3256
> 
3256
> xyz.coords(data.frame(x = -1:9, y = 2:12, z = 3:13), y = NULL, z = NULL,
3257
> xyz.coords(data.frame(x = -1:9, y = 2:12, z = 3:13), y = NULL, z = NULL,
3257
+            log = "xy")
3258
+            log = "xy")
3258
Warning in xyz.coords(data.frame(x = -1:9, y = 2:12, z = 3:13), y = NULL,  :
3259
Warning in xyz.coords(data.frame(x = -1:9, y = 2:12, z = 3:13), y = NULL,  :
3259
  2 x values <= 0 omitted from logarithmic plot
3260
  2 x values <= 0 omitted from logarithmic plot
3260
$x
3261
$x
3261
 [1] NA NA  1  2  3  4  5  6  7  8  9
3262
 [1] NA NA  1  2  3  4  5  6  7  8  9
3262
 
3263
 
3263
$y
3264
$y
3264
 [1]  2  3  4  5  6  7  8  9 10 11 12
3265
 [1]  2  3  4  5  6  7  8  9 10 11 12
3265
 
3266
 
3266
$z
3267
$z
3267
 [1]  3  4  5  6  7  8  9 10 11 12 13
3268
 [1]  3  4  5  6  7  8  9 10 11 12 13
3268
 
3269
 
3269
$xlab
3270
$xlab
3270
[1] "x"
3271
[1] "x"
3271
 
3272
 
3272
$ylab
3273
$ylab
3273
[1] "y"
3274
[1] "y"
3274
 
3275
 
3275
$zlab
3276
$zlab
3276
[1] "z"
3277
[1] "z"
3277
 
3278
 
3278
> ##> Warning message: 2 x values <= 0 omitted ...
3279
> ##> Warning message: 2 x values <= 0 omitted ...
3279
> 
3280
> 
3280
> 
3281
> 
3281
> 
3282
> 
3282
> ### * <FOOTER>
3283
> ### * <FOOTER>
3283
> ###
3284
> ###
3284
> cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
3285
> cat("Time elapsed: ", proc.time() - get("ptime", pos = 'CheckExEnv'),"\n")
3285
Time elapsed:  8.22 1.94 10.2 NA NA 
3286
Time elapsed:  8.22 1.94 10.2 NA NA 
3286
> grDevices::dev.off()
3287
> grDevices::dev.off()
3287
null device 
3288
null device 
3288
          1 
3289
          1 
3289
> ###
3290
> ###
3290
> ### Local variables: ***
3291
> ### Local variables: ***
3291
> ### mode: outline-minor ***
3292
> ### mode: outline-minor ***
3292
> ### outline-regexp: "\\(> \\)?### [*]+" ***
3293
> ### outline-regexp: "\\(> \\)?### [*]+" ***
3293
> ### End: ***
3294
> ### End: ***
3294
> quit('no')
3295
> quit('no')
-