Révision 2477
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/RSclient/R/RSclient (revision 2477) | ||
---|---|---|
1 |
# File share/R/nspackloader.R |
|
2 |
# Part of the R package, http://www.R-project.org |
|
3 |
# |
|
4 |
# Copyright (C) 1995-2012 The R Core Team |
|
5 |
# |
|
6 |
# This program is free software; you can redistribute it and/or modify |
|
7 |
# it under the terms of the GNU General Public License as published by |
|
8 |
# the Free Software Foundation; either version 2 of the License, or |
|
9 |
# (at your option) any later version. |
|
10 |
# |
|
11 |
# This program is distributed in the hope that it will be useful, |
|
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
# GNU General Public License for more details. |
|
15 |
# |
|
16 |
# A copy of the GNU General Public License is available at |
|
17 |
# http://www.r-project.org/Licenses/ |
|
18 |
|
|
19 |
local({ |
|
20 |
info <- loadingNamespaceInfo() |
|
21 |
pkg <- info$pkgname |
|
22 |
ns <- .getNamespace(as.name(pkg)) |
|
23 |
if (is.null(ns)) |
|
24 |
stop("cannot find namespace environment for ", pkg, domain = NA); |
|
25 |
dbbase <- file.path(info$libname, pkg, "R", pkg) |
|
26 |
lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.") |
|
27 |
}) |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/RSclient/html/R.css (revision 2477) | ||
---|---|---|
1 |
body { |
|
2 |
background: white; |
|
3 |
color: black; |
|
4 |
} |
|
5 |
|
|
6 |
a:link { |
|
7 |
background: white; |
|
8 |
color: blue; |
|
9 |
} |
|
10 |
|
|
11 |
a:visited { |
|
12 |
background: white; |
|
13 |
color: rgb(50%, 0%, 50%); |
|
14 |
} |
|
15 |
|
|
16 |
h1 { |
|
17 |
background: white; |
|
18 |
color: rgb(55%, 55%, 55%); |
|
19 |
font-family: monospace; |
|
20 |
font-size: x-large; |
|
21 |
text-align: center; |
|
22 |
} |
|
23 |
|
|
24 |
h2 { |
|
25 |
background: white; |
|
26 |
color: rgb(40%, 40%, 40%); |
|
27 |
font-family: monospace; |
|
28 |
font-size: large; |
|
29 |
text-align: center; |
|
30 |
} |
|
31 |
|
|
32 |
h3 { |
|
33 |
background: white; |
|
34 |
color: rgb(40%, 40%, 40%); |
|
35 |
font-family: monospace; |
|
36 |
font-size: large; |
|
37 |
} |
|
38 |
|
|
39 |
h4 { |
|
40 |
background: white; |
|
41 |
color: rgb(40%, 40%, 40%); |
|
42 |
font-family: monospace; |
|
43 |
font-style: italic; |
|
44 |
font-size: large; |
|
45 |
} |
|
46 |
|
|
47 |
h5 { |
|
48 |
background: white; |
|
49 |
color: rgb(40%, 40%, 40%); |
|
50 |
font-family: monospace; |
|
51 |
} |
|
52 |
|
|
53 |
h6 { |
|
54 |
background: white; |
|
55 |
color: rgb(40%, 40%, 40%); |
|
56 |
font-family: monospace; |
|
57 |
font-style: italic; |
|
58 |
} |
|
59 |
|
|
60 |
img.toplogo { |
|
61 |
width: 4em; |
|
62 |
vertical-align: middle; |
|
63 |
} |
|
64 |
|
|
65 |
img.arrow { |
|
66 |
width: 30px; |
|
67 |
height: 30px; |
|
68 |
border: 0; |
|
69 |
} |
|
70 |
|
|
71 |
span.acronym { |
|
72 |
font-size: small; |
|
73 |
} |
|
74 |
|
|
75 |
span.env { |
|
76 |
font-family: monospace; |
|
77 |
} |
|
78 |
|
|
79 |
span.file { |
|
80 |
font-family: monospace; |
|
81 |
} |
|
82 |
|
|
83 |
span.option{ |
|
84 |
font-family: monospace; |
|
85 |
} |
|
86 |
|
|
87 |
span.pkg { |
|
88 |
font-weight: bold; |
|
89 |
} |
|
90 |
|
|
91 |
span.samp{ |
|
92 |
font-family: monospace; |
|
93 |
} |
|
94 |
|
|
95 |
div.vignettes a:hover { |
|
96 |
background: rgb(85%, 85%, 85%); |
|
97 |
} |
|
0 | 98 |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/RSclient/html/00Index.html (revision 2477) | ||
---|---|---|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
3 |
<head><title>R: Client for Rserve</title> |
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
5 |
<link rel="stylesheet" type="text/css" href="R.css" /> |
|
6 |
</head><body> |
|
7 |
<h1> Client for Rserve |
|
8 |
<img class="toplogo" src="../../../doc/html/Rlogo.svg" alt="[R logo]" /> |
|
9 |
</h1> |
|
10 |
<hr/> |
|
11 |
<div style="text-align: center;"> |
|
12 |
<a href="../../../doc/html/packages.html"><img class="arrow" src="../../../doc/html/left.jpg" alt="[Up]" /></a> |
|
13 |
<a href="../../../doc/html/index.html"><img class="arrow" src="../../../doc/html/up.jpg" alt="[Top]" /></a> |
|
14 |
</div><h2>Documentation for package ‘RSclient’ version 0.7-3</h2> |
|
15 |
|
|
16 |
<ul><li><a href="../DESCRIPTION">DESCRIPTION file</a>.</li> |
|
17 |
<li><a href="../NEWS">Package NEWS</a>.</li> |
|
18 |
</ul> |
|
19 |
|
|
20 |
<h2>Help Pages</h2> |
|
21 |
|
|
22 |
|
|
23 |
<table width="100%"> |
|
24 |
<tr><td style="width: 25%;"><a href="RC-methods.html">!=.RserveConnection</a></td> |
|
25 |
<td>Methods for the RserveConnection class</td></tr> |
|
26 |
<tr><td style="width: 25%;"><a href="RC-methods.html">==.RserveConnection</a></td> |
|
27 |
<td>Methods for the RserveConnection class</td></tr> |
|
28 |
<tr><td style="width: 25%;"><a href="RC-methods.html">print.RserveConnection</a></td> |
|
29 |
<td>Methods for the RserveConnection class</td></tr> |
|
30 |
<tr><td style="width: 25%;"><a href="RC-methods.html">RC-methods</a></td> |
|
31 |
<td>Methods for the RserveConnection class</td></tr> |
|
32 |
<tr><td style="width: 25%;"><a href="RCC.html">RCC</a></td> |
|
33 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
34 |
<tr><td style="width: 25%;"><a href="Rclient.html">Rclient</a></td> |
|
35 |
<td>Functions to talk to an Rserve</td></tr> |
|
36 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.assign</a></td> |
|
37 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
38 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.authkey</a></td> |
|
39 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
40 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.close</a></td> |
|
41 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
42 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.collect</a></td> |
|
43 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
44 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.connect</a></td> |
|
45 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
46 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.eval</a></td> |
|
47 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
48 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.eval.qap</a></td> |
|
49 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
50 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.login</a></td> |
|
51 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
52 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.oobCallbacks</a></td> |
|
53 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
54 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.server.eval</a></td> |
|
55 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
56 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.server.shutdown</a></td> |
|
57 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
58 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.server.source</a></td> |
|
59 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
60 |
<tr><td style="width: 25%;"><a href="RCC.html">RS.switch</a></td> |
|
61 |
<td>Functions to talk to an Rserve instance (new version)</td></tr> |
|
62 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSassign</a></td> |
|
63 |
<td>Functions to talk to an Rserve</td></tr> |
|
64 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSattach</a></td> |
|
65 |
<td>Functions to talk to an Rserve</td></tr> |
|
66 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSclose</a></td> |
|
67 |
<td>Functions to talk to an Rserve</td></tr> |
|
68 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSconnect</a></td> |
|
69 |
<td>Functions to talk to an Rserve</td></tr> |
|
70 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSdetach</a></td> |
|
71 |
<td>Functions to talk to an Rserve</td></tr> |
|
72 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSeval</a></td> |
|
73 |
<td>Functions to talk to an Rserve</td></tr> |
|
74 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSevalDetach</a></td> |
|
75 |
<td>Functions to talk to an Rserve</td></tr> |
|
76 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSlogin</a></td> |
|
77 |
<td>Functions to talk to an Rserve</td></tr> |
|
78 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSserverEval</a></td> |
|
79 |
<td>Functions to talk to an Rserve</td></tr> |
|
80 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSserverSource</a></td> |
|
81 |
<td>Functions to talk to an Rserve</td></tr> |
|
82 |
<tr><td style="width: 25%;"><a href="Rclient.html">RSshutdown</a></td> |
|
83 |
<td>Functions to talk to an Rserve</td></tr> |
|
84 |
</table> |
|
85 |
</body></html> |
|
0 | 86 |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/RSclient/help/AnIndex (revision 2477) | ||
---|---|---|
1 |
!=.RserveConnection RC-methods |
|
2 |
==.RserveConnection RC-methods |
|
3 |
print.RserveConnection RC-methods |
|
4 |
RC-methods RC-methods |
|
5 |
RCC RCC |
|
6 |
Rclient Rclient |
|
7 |
RS.assign RCC |
|
8 |
RS.authkey RCC |
|
9 |
RS.close RCC |
|
10 |
RS.collect RCC |
|
11 |
RS.connect RCC |
|
12 |
RS.eval RCC |
|
13 |
RS.eval.qap RCC |
|
14 |
RS.login RCC |
|
15 |
RS.oobCallbacks RCC |
|
16 |
RS.server.eval RCC |
|
17 |
RS.server.shutdown RCC |
|
18 |
RS.server.source RCC |
|
19 |
RS.switch RCC |
|
20 |
RSassign Rclient |
|
21 |
RSattach Rclient |
|
22 |
RSclose Rclient |
|
23 |
RSconnect Rclient |
|
24 |
RSdetach Rclient |
|
25 |
RSeval Rclient |
|
26 |
RSevalDetach Rclient |
|
27 |
RSlogin Rclient |
|
28 |
RSserverEval Rclient |
|
29 |
RSserverSource Rclient |
|
30 |
RSshutdown Rclient |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/RSclient/libs/RSclient.so.dSYM/Contents/Info.plist (revision 2477) | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
|
3 |
<plist version="1.0"> |
|
4 |
<dict> |
|
5 |
<key>CFBundleDevelopmentRegion</key> |
|
6 |
<string>English</string> |
|
7 |
<key>CFBundleIdentifier</key> |
|
8 |
<string>com.apple.xcode.dsym.RSclient.so</string> |
|
9 |
<key>CFBundleInfoDictionaryVersion</key> |
|
10 |
<string>6.0</string> |
|
11 |
<key>CFBundlePackageType</key> |
|
12 |
<string>dSYM</string> |
|
13 |
<key>CFBundleSignature</key> |
|
14 |
<string>????</string> |
|
15 |
<key>CFBundleShortVersionString</key> |
|
16 |
<string>1.0</string> |
|
17 |
<key>CFBundleVersion</key> |
|
18 |
<string>1</string> |
|
19 |
</dict> |
|
20 |
</plist> |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/R/lattice (revision 2477) | ||
---|---|---|
1 |
# File share/R/nspackloader.R |
|
2 |
# Part of the R package, http://www.R-project.org |
|
3 |
# |
|
4 |
# Copyright (C) 1995-2012 The R Core Team |
|
5 |
# |
|
6 |
# This program is free software; you can redistribute it and/or modify |
|
7 |
# it under the terms of the GNU General Public License as published by |
|
8 |
# the Free Software Foundation; either version 2 of the License, or |
|
9 |
# (at your option) any later version. |
|
10 |
# |
|
11 |
# This program is distributed in the hope that it will be useful, |
|
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
# GNU General Public License for more details. |
|
15 |
# |
|
16 |
# A copy of the GNU General Public License is available at |
|
17 |
# http://www.r-project.org/Licenses/ |
|
18 |
|
|
19 |
local({ |
|
20 |
info <- loadingNamespaceInfo() |
|
21 |
pkg <- info$pkgname |
|
22 |
ns <- .getNamespace(as.name(pkg)) |
|
23 |
if (is.null(ns)) |
|
24 |
stop("cannot find namespace environment for ", pkg, domain = NA); |
|
25 |
dbbase <- file.path(info$libname, pkg, "R", pkg) |
|
26 |
lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.") |
|
27 |
}) |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/dotplotscoping.R (revision 2477) | ||
---|---|---|
1 |
postscript("dotplotscoping.ps") |
|
2 |
library(lattice) |
|
3 |
|
|
4 |
fubar <- function() { |
|
5 |
k <- 2 |
|
6 |
kkk <- 1:10 |
|
7 |
names(kkk) <- 1:10 |
|
8 |
data = list(x=kkk) |
|
9 |
dotplot(~x^k + rnorm(10), data) |
|
10 |
} |
|
11 |
|
|
12 |
fubar() |
|
13 |
dev.off() |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/scales.R (revision 2477) | ||
---|---|---|
1 |
|
|
2 |
postscript("scales.ps") |
|
3 |
## Testing weird scales options |
|
4 |
|
|
5 |
library(lattice) |
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
## relation = "free" for factors |
|
10 |
|
|
11 |
dat <- data.frame(a=letters[1:5], b=c("A","A","A","B","B"), y=1:5) |
|
12 |
dotplot(y ~ a | b, data=dat, scales = "same") |
|
13 |
dotplot(y ~ a | b, data=dat, scales = "free") |
|
14 |
dotplot(y ~ a | b, data=dat, scales = "sliced") |
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
dat <- |
|
19 |
data.frame(a = letters[1:10], |
|
20 |
b = c("A","A","A","B","B","A","B","B", "A", "A")) |
|
21 |
|
|
22 |
dat <- dat[sample(1:10, 200, rep = TRUE), ] |
|
23 |
dat$y <- rnorm(200, mean = unclass(as.factor(dat$a))) |
|
24 |
|
|
25 |
bwplot(a ~ y | b, data=dat, scales = "same") |
|
26 |
bwplot(a ~ y | b, data=dat, scales = "free") |
|
27 |
bwplot(a ~ y | b, data=dat, scales = "sliced") |
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
## text axis colors |
|
35 |
|
|
36 |
xyplot(1:10 ~ 1:10, |
|
37 |
scales = |
|
38 |
list(y = list(font = 2, |
|
39 |
cex = 1, |
|
40 |
col = "green", col.line = "cyan", tck = 5)), |
|
41 |
xlab = list("one to ten", fontfamily = "HersheySerif"), |
|
42 |
par.settings = |
|
43 |
list(axis.text = list(col = "red", font = 4, cex = 3), |
|
44 |
axis.line = list(col = "yellow"))) |
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
x <- rnorm(100) |
|
50 |
y <- 2 + 3 * runif(100) |
|
51 |
a <- gl(3, 1, 100) |
|
52 |
|
|
53 |
xyplot(y ~ x | a) |
|
54 |
|
|
55 |
xyplot(y ~ x | a, scales = list(axs = "i")) |
|
56 |
|
|
57 |
xyplot(y ~ x | a, xlim = c(-5, 5), scales = list(limits = c(-6, 6))) |
|
58 |
|
|
59 |
xyplot(y ~ x | a, xlim = c(-5, 5), ylim = letters[1:5]) |
|
60 |
|
|
61 |
|
|
62 |
## Should produce an error |
|
63 |
cat(try(print(xyplot(y ~ x | a, scales = list(x = list( relation = "same", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) )))), silent = TRUE)) |
|
64 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) |
|
65 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) |
|
66 |
|
|
67 |
## Should produce an error |
|
68 |
cat(try(print(xyplot(y ~ x | a, xlim = list( c(-5, 5), c(-4, 4), c(-3, 3) ), scales = list(x = list( relation = "same", axs = "i")))), silent = TRUE)) |
|
69 |
xyplot(y ~ x | a, xlim = list( c(-5, 5), c(-4, 4), c(-3, 3) ), scales = list(x = list( relation = "free", axs = "i"))) |
|
70 |
xyplot(y ~ x | a, xlim = list( c(-5, 5), c(-4, 4), c(-3, 3) ), scales = list(x = list( relation = "sliced", axs = "i"))) |
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free" ))) |
|
76 |
|
|
77 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", limits = c(-5, 5)))) |
|
78 |
|
|
79 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) |
|
80 |
|
|
81 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", |
|
82 |
limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), |
|
83 |
at = c(-3, 3, 0)))) |
|
84 |
|
|
85 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", |
|
86 |
limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), |
|
87 |
at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) )))) |
|
88 |
|
|
89 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", |
|
90 |
limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), |
|
91 |
at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), |
|
92 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) |
|
93 |
|
|
94 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", |
|
95 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
96 |
at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), |
|
97 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) |
|
98 |
|
|
99 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", |
|
100 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
101 |
at = list( c(0, 5, -5) , c(-4, 0, 4), FALSE ), |
|
102 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) |
|
103 |
|
|
104 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", |
|
105 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
106 |
at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), |
|
107 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) |
|
108 |
|
|
109 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", rot = 45, |
|
110 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
111 |
at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), |
|
112 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], month.name[1:5] )))) |
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced" ))) |
|
123 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced" , axs = "i" ))) |
|
124 |
|
|
125 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", limits = c(-5, 5)))) |
|
126 |
|
|
127 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", axs = "i", limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ) ))) |
|
128 |
|
|
129 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", |
|
130 |
limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), |
|
131 |
at = c(-3, 3, 0)))) |
|
132 |
|
|
133 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", |
|
134 |
limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), |
|
135 |
at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) )))) |
|
136 |
|
|
137 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", |
|
138 |
limits = list( c(-5, 5), c(-4, 4), c(-3, 3) ), |
|
139 |
at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), |
|
140 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) |
|
141 |
|
|
142 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", |
|
143 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
144 |
at = list( c(0, 5, -5) , c(-4, 0, 4), c(-3, 3, 0) ), |
|
145 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], c(-3, 3, 0) )))) |
|
146 |
|
|
147 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", |
|
148 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
149 |
at = list( c(0, 5, -5) , c(-4, 0, 4), FALSE ), |
|
150 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) |
|
151 |
|
|
152 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", |
|
153 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
154 |
at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), |
|
155 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], FALSE )))) |
|
156 |
|
|
157 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", rot = 45, |
|
158 |
limits = list( c(-5, 5), c(-4, 4), letters[1:5] ), |
|
159 |
at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ), |
|
160 |
labels = list( as.character(c(0, 5, -5)) , letters[5:7], month.name[1:5] )))) |
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
xyplot(y ~ x | a, scales = list(x = list( relation = "free", at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 )))) |
|
166 |
xyplot(y ~ x | a, scales = list(x = list( relation = "sliced", at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 )))) |
|
167 |
|
|
168 |
## should produce an error |
|
169 |
cat(try(print(xyplot(y ~ x | a, scales = list(y = list( relation = "same", at = list( c(0, 5, -5) , c(-4, 0, 4), 1:5 ))))), silent = TRUE)) |
|
170 |
|
|
171 |
|
|
172 |
## problem |
|
173 |
stripplot(rep(1:20, 5) ~ x | a, scales = list(relation = "free", col = "transparent")) |
|
174 |
dev.off() |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/test.R (revision 2477) | ||
---|---|---|
1 |
postscript("test.ps") |
|
2 |
library(lattice) |
|
3 |
|
|
4 |
lattice.options(default.args = |
|
5 |
list(page = function(n) { |
|
6 |
grid::grid.text(label = paste(deparse(trellis.last.object()$call, width.cutoff = 150L), collapse = "\n"), |
|
7 |
x = 0.01, y = 0.99, just = c("left", "top")) |
|
8 |
})) |
|
9 |
|
|
10 |
densityplot(~ 5) |
|
11 |
densityplot(~ 1:5 | letters[1:5]) |
|
12 |
|
|
13 |
x <- rnorm(200) |
|
14 |
y <- rnorm(200) |
|
15 |
z <- equal.count(rnorm(200)) |
|
16 |
a <- factor(rep(1:3, len = 200)) |
|
17 |
|
|
18 |
df.test <- list(xx = x+1-min(x), yy = y, zz = z, aa = a) |
|
19 |
|
|
20 |
xyplot(y ~ x | z * a, strip = function(...) strip.default(..., style = 4), |
|
21 |
par.strip.text = list(cex = 2, col = "blue", font = 2), |
|
22 |
##scales = list(x = list(draw = FALSE), y = "sliced")) |
|
23 |
scales = list(x = list(rot = 0), y = list(rot = 0))) |
|
24 |
|
|
25 |
xyplot(a ~ x | z, |
|
26 |
main = "xyplot call with modified options", |
|
27 |
lattice.options = |
|
28 |
list(panel.xyplot = "panel.bwplot", |
|
29 |
default.args = list(between = list(x = 1, y = 1)))) |
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
bwplot(zz ~ xx | aa, df.test) |
|
35 |
|
|
36 |
bwplot(aa ~ xx | zz, df.test, |
|
37 |
scales = |
|
38 |
list(x = list(log = "e", tck = 5, rot = 90, cex = 2), |
|
39 |
y = list(col = "red", tck = 3, alternating = TRUE, cex = 5, rot = 0), |
|
40 |
tick.number = 20), |
|
41 |
main = list("main", cex = 5), |
|
42 |
sub = list("sub", cex = 5), |
|
43 |
xlab = list("xlab", cex = 5), |
|
44 |
ylab = list("ylab", cex = 5)) |
|
45 |
|
|
46 |
|
|
47 |
bwplot(~zz , df.test) |
|
48 |
bwplot(~xx , df.test) |
|
49 |
|
|
50 |
dotplot(zz ~ xx | aa, df.test) |
|
51 |
dotplot(aa ~ xx | zz, df.test) |
|
52 |
|
|
53 |
dotplot(~zz , df.test) |
|
54 |
dotplot(~xx , df.test) |
|
55 |
|
|
56 |
stripplot(zz ~ xx | aa, df.test) |
|
57 |
stripplot(aa ~ xx | zz, df.test) |
|
58 |
stripplot(~zz , df.test) |
|
59 |
stripplot(~xx , df.test) |
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
xa <- 1:8 |
|
64 |
xb <- rep( c( NA, 10 ), 4 ) |
|
65 |
|
|
66 |
xc <- rep( c( 'C2', 'C1' ), 4 ) |
|
67 |
xyplot( xa ~ xb | xc) |
|
68 |
xyplot( xa ~ xb | xc, scales = "free") |
|
69 |
|
|
70 |
xc <- rep( c( 'C1', 'C2' ), 4 ) |
|
71 |
xyplot( xa ~ xb | xc) |
|
72 |
xyplot( xa ~ xb | xc, scales = "free") |
|
73 |
|
|
74 |
x = sample(1:3, 100, replace=TRUE) |
|
75 |
histogram( ~ x, breaks=c(0,1.5,2.5,3.5), type='count') |
|
76 |
histogram( ~ x, breaks=c(0,1.5,2.5,3.5), type='density') |
|
77 |
|
|
78 |
|
|
79 |
## splom pscales |
|
80 |
|
|
81 |
data(iris) |
|
82 |
iris2 <- iris[,1:4] |
|
83 |
|
|
84 |
splom(iris2, groups = iris$Species, |
|
85 |
pscales = 10) |
|
86 |
|
|
87 |
splom(iris2, groups = iris$Species, |
|
88 |
pscales = list(list(at = 6, lab = "six"), list(at = 3), list(at = 4), list(at = 1))) |
|
89 |
|
|
90 |
splom(iris2, groups = iris$Species, |
|
91 |
pscales = list(list(at = 6, lab = "six", limits = c(-10, 10)), |
|
92 |
list(at = 3), list(at = 4), list(limits = c(-5, 5)))) |
|
93 |
|
|
94 |
|
|
95 |
## factors in formula |
|
96 |
|
|
97 |
data(barley) |
|
98 |
levelplot(yield ~ year * variety | site, barley, |
|
99 |
panel = function(x, y, ...) { |
|
100 |
x <- as.numeric(x) |
|
101 |
y <- as.numeric(y) |
|
102 |
panel.levelplot(x, y, ...) |
|
103 |
}) |
|
104 |
|
|
105 |
|
|
106 |
data(volcano) |
|
107 |
levelplot(volcano, key = list(x = .5, y = .5, points = list(col = 1:3)), |
|
108 |
legend = list(top = list(fun = grid::textGrob("This \nis \na \nstupid \nlegend")))) |
|
109 |
|
|
110 |
|
|
111 |
## demo of seekViewport |
|
112 |
|
|
113 |
library(grid) |
|
114 |
|
|
115 |
splom(~iris[1:3]|Species, data = iris, |
|
116 |
layout=c(2,2), pscales = 0, |
|
117 |
varnames = c("Sepal\nLength", "Sepal\nWidth", "Petal\nLength"), |
|
118 |
page = function(...) { |
|
119 |
ltext(x = seq(.6, .8, len = 4), |
|
120 |
y = seq(.9, .6, len = 4), |
|
121 |
lab = c("Three", "Varieties", "of", "Iris"), |
|
122 |
cex = 2) |
|
123 |
}, par.settings = list(clip = list(panel = FALSE))) |
|
124 |
|
|
125 |
seekViewport(vpPath(trellis.vpname("panel", 1, 1), "pairs", "subpanel.2.3")) |
|
126 |
grid.yaxis(main = TRUE) |
|
127 |
|
|
128 |
seekViewport(vpPath(trellis.vpname("panel", 2, 1), "pairs", "subpanel.2.1")) |
|
129 |
grid.yaxis(main = FALSE) |
|
130 |
|
|
131 |
seekViewport(vpPath(trellis.vpname("panel", 1, 2), "pairs", "subpanel.2.2")) |
|
132 |
grid.yaxis(main = FALSE) |
|
133 |
|
|
134 |
demo("lattice") |
|
135 |
dev.off() |
|
136 |
|
|
137 |
|
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/dates.R (revision 2477) | ||
---|---|---|
1 |
|
|
2 |
postscript("date.ps") |
|
3 |
library(lattice) |
|
4 |
|
|
5 |
## POSIXt handling |
|
6 |
|
|
7 |
y <- Sys.time() + 10000 * 1:100 |
|
8 |
x <- rnorm(100) |
|
9 |
b <- gl(3,1,100) |
|
10 |
|
|
11 |
xyplot(y ~ x | b) |
|
12 |
xyplot(y ~ x | b, scales = list(relation = "free", rot = 0)) |
|
13 |
xyplot(y ~ x | b, scales = "sliced") |
|
14 |
|
|
15 |
## Date handling |
|
16 |
|
|
17 |
dat <- |
|
18 |
data.frame(a = 1:10, |
|
19 |
b = seq(as.Date("2003/1/1"), as.Date("2003/1/10"), by="day")) |
|
20 |
xyplot(a~b, dat) |
|
21 |
xyplot(a~b, dat, scales=list(x=list(at=dat$b))) |
|
22 |
|
|
23 |
|
|
24 |
dev.off() |
|
25 |
|
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/fontsize.R (revision 2477) | ||
---|---|---|
1 |
pdf("fontsize.pdf", pointsize = 5) |
|
2 |
library(lattice) |
|
3 |
|
|
4 |
splom(iris, sub = "fontsize : 5") |
|
5 |
|
|
6 |
trellis.par.set(grid.pars = list(fontsize = 10)) |
|
7 |
splom(iris, sub = "fontsize : 10") |
|
8 |
|
|
9 |
trellis.par.set(fontsize = list(text = 15)) |
|
10 |
splom(iris, sub = "fontsize : 15") |
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/wireframe.R (revision 2477) | ||
---|---|---|
1 |
|
|
2 |
library(lattice) |
|
3 |
data(volcano) |
|
4 |
|
|
5 |
foo <- |
|
6 |
data.frame(z = as.vector(volcano), |
|
7 |
x = rep(1:87, 61), |
|
8 |
y = rep(1:61, each = 87)) |
|
9 |
|
|
10 |
wireframe(z ~ x * y, foo) |
|
11 |
|
|
12 |
## this used to give an error, but seems fine now (?) |
|
13 |
wireframe(z ~ x * y, foo, subset = z > 150) |
|
14 |
|
|
15 |
|
|
16 |
## Example 1 (a). valgrind shows warnings, starting with |
|
17 |
|
|
18 |
|
|
19 |
## ==9058== Invalid read of size 8 |
|
20 |
## ==9058== at 0xA450AFF: wireframePanelCalculations (threeDplot.c:291) |
|
21 |
|
|
22 |
## and subsequently in various other places in that function leading to |
|
23 |
|
|
24 |
## ==9058== Conditional jump or move depends on uninitialised value(s) |
|
25 |
## ==9058== at 0x3FFAA466CF: __printf_fp (in /lib64/libc-2.4.so) |
|
26 |
## ==9058== by 0x3FFAA423AE: vfprintf (in /lib64/libc-2.4.so) |
|
27 |
## ==9058== by 0x3FFAA4A477: fprintf (in /lib64/libc-2.4.so) |
|
28 |
## ==9058== by 0x94975BE: PostScriptRLineTo (devPS.c:2683) |
|
29 |
|
|
30 |
## A bit more tracing shows it is accessing element 4016 in an array of |
|
31 |
## length 2456, and the plot seems nonsense (and random) when viewed on |
|
32 |
## screen. (BDR, 2006/09/17) |
|
33 |
|
|
34 |
## DS's earlier comment: what's this supposed to do ? weird thing is, |
|
35 |
## result is random (probably indicator of memory access errors) |
|
36 |
|
|
37 |
if (FALSE) |
|
38 |
{ |
|
39 |
|
|
40 |
wireframe(z + I(z + 100) ~ x * y, foo, |
|
41 |
subset = z > 150, |
|
42 |
scales = list(arrows = FALSE)) |
|
43 |
} |
|
44 |
|
|
45 |
## this works as expected |
|
46 |
|
|
47 |
wireframe(z + I(z + 100) ~ x * y, foo) |
|
48 |
|
|
49 |
## Example 1 (b). Another way of seeing the problem: |
|
50 |
|
|
51 |
## this is OK: |
|
52 |
|
|
53 |
bar <- foo |
|
54 |
bar$z[bar$z < 150] <- NA |
|
55 |
wireframe(z + I(z + 100) ~ x * y, bar, |
|
56 |
scales = list(arrows = FALSE)) |
|
57 |
|
|
58 |
## but this is not |
|
59 |
if (FALSE) |
|
60 |
{ |
|
61 |
wireframe(z + I(z + 100) ~ x * y, |
|
62 |
subset(bar, !is.na(z)), |
|
63 |
scales = list(arrows = FALSE)) |
|
64 |
} |
|
65 |
|
|
66 |
|
|
67 |
## Example 2. Probably another example of the same "bug": see |
|
68 |
## https://stat.ethz.ch/pipermail/r-devel/2005-September/034544.html |
|
69 |
|
|
70 |
|
|
71 |
library(lattice) |
|
72 |
|
|
73 |
n <- 20 |
|
74 |
psteps <- 50 |
|
75 |
binomtable <- function(n, psteps) |
|
76 |
{ |
|
77 |
x <- (0:(10*n))/10 |
|
78 |
p <- (0:psteps)/psteps |
|
79 |
dd <- expand.grid(x=x,p=p) |
|
80 |
dd$F <- pbinom(dd$x,n,dd$p) |
|
81 |
dd$x0 <-trunc(dd$x) |
|
82 |
dd |
|
83 |
} |
|
84 |
|
|
85 |
bt <- binomtable(n = 5, psteps = 100) |
|
86 |
bt[bt$x - bt$x0 >= 0.9, ]$F <- NA |
|
87 |
|
|
88 |
if (FALSE) |
|
89 |
{ |
|
90 |
## this is problematic |
|
91 |
wireframe(F ~ x * p, bt, |
|
92 |
groups = bt$x0, shade = TRUE, |
|
93 |
scales = list(arrows = FALSE)) |
|
94 |
} |
|
95 |
|
|
96 |
## this one OK |
|
97 |
wireframe(F ~ x * p, bt, shade = TRUE, |
|
98 |
scales = list(arrows = FALSE)) |
|
99 |
|
|
100 |
## this too |
|
101 |
wireframe(F ~ x * p | factor(x0), bt, |
|
102 |
## groups = bt$x0, |
|
103 |
shade = TRUE, |
|
104 |
scales = list(arrows = FALSE)) |
|
105 |
|
|
106 |
|
|
107 |
## Working hypothesis: the problem crops up when there are groups |
|
108 |
## (specified either directly or through the formula interface) AND x |
|
109 |
## and y values for each group don't represent the full evaluation |
|
110 |
## grid. The second condition is a bit unclear. In example 2, each |
|
111 |
## group's support is disjoint from that of the others. In example 1, |
|
112 |
## both groups have the same support, they are just not the full grid. |
|
113 |
|
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/MASSch04.R (revision 2477) | ||
---|---|---|
1 |
#-*- R -*- |
|
2 |
|
|
3 |
## Script from Fourth Edition of `Modern Applied Statistics with S' |
|
4 |
|
|
5 |
# Chapter 4 Graphical Output |
|
6 |
|
|
7 |
library(MASS) |
|
8 |
library(lattice) |
|
9 |
trellis.device(postscript, file="ch04.ps", width=8, height=6, |
|
10 |
pointsize=9) |
|
11 |
options(echo=T, width=65, digits=5) |
|
12 |
|
|
13 |
|
|
14 |
# 4.2 Basic plotting functions |
|
15 |
|
|
16 |
topo.loess <- loess(z ~ x * y, topo, degree = 2, span = 0.25) |
|
17 |
topo.mar <- list(x = seq(0, 6.5, 0.2), y=seq(0, 6.5, 0.2)) |
|
18 |
topo.lo <- predict(topo.loess, expand.grid(topo.mar)) |
|
19 |
topo.lo1 <- cbind(expand.grid(x=topo.mar$x, y=topo.mar$y), |
|
20 |
z=as.vector(topo.lo)) |
|
21 |
contourplot(z ~ x * y, topo.lo1, aspect = 1, |
|
22 |
at = seq(700, 1000, 25), xlab = "", ylab = "", |
|
23 |
panel = function(x, y, subscripts, ...) { |
|
24 |
panel.levelplot(x, y, subscripts, ...) |
|
25 |
panel.xyplot(topo$x, topo$y, cex = 0.5) |
|
26 |
} |
|
27 |
) |
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
# 4.5 Trellis graphics |
|
36 |
|
|
37 |
|
|
38 |
xyplot(time ~ dist, data = hills, |
|
39 |
panel = function(x, y, ...) { |
|
40 |
panel.xyplot(x, y, ...) |
|
41 |
panel.lmline(x, y, type = "l") |
|
42 |
panel.abline(lqs(y ~ x), lty = 3) |
|
43 |
# identify(x, y, row.names(hills)) |
|
44 |
} |
|
45 |
) |
|
46 |
|
|
47 |
bwplot(Expt ~ Speed, data = michelson, ylab = "Experiment No.", |
|
48 |
main = "Speed of Light Data") |
|
49 |
|
|
50 |
|
|
51 |
data(swiss) |
|
52 |
splom(~ swiss, aspect = "fill", |
|
53 |
panel = function(x, y, ...) { |
|
54 |
panel.xyplot(x, y, ...); panel.loess(x, y, ...) |
|
55 |
} |
|
56 |
) |
|
57 |
|
|
58 |
sps <- trellis.par.get("superpose.symbol") |
|
59 |
sps$pch <- 1:7 |
|
60 |
trellis.par.set("superpose.symbol", sps) |
|
61 |
xyplot(Time ~ Viscosity, data = stormer, groups = Wt, |
|
62 |
panel = panel.superpose, type = "b", |
|
63 |
key = list(columns = 3, |
|
64 |
text = list(paste(c("Weight: ", "", ""), |
|
65 |
unique(stormer$Wt), "gms")), |
|
66 |
points = Rows(sps, 1:3) |
|
67 |
) |
|
68 |
) |
|
69 |
rm(sps) |
|
70 |
|
|
71 |
topo.plt <- expand.grid(topo.mar) |
|
72 |
topo.plt$pred <- as.vector(predict(topo.loess, topo.plt)) |
|
73 |
levelplot(pred ~ x * y, topo.plt, aspect = 1, |
|
74 |
at = seq(690, 960, 10), xlab = "", ylab = "", |
|
75 |
panel = function(x, y, subscripts, ...) { |
|
76 |
panel.levelplot(x, y, subscripts, ...) |
|
77 |
panel.xyplot(topo$x,topo$y, cex = 0.5, col = 1) |
|
78 |
} |
|
79 |
) |
|
80 |
|
|
81 |
## if (F) { |
|
82 |
wireframe(pred ~ x * y, topo.plt, aspect = c(1, 0.5), |
|
83 |
drape = T, screen = list(z = -150, x = -60), |
|
84 |
colorkey = list(space="right", height=0.6)) |
|
85 |
## } |
|
86 |
|
|
87 |
lcrabs.pc <- predict(princomp(log(crabs[,4:8]))) |
|
88 |
crabs.grp <- c("B", "b", "O", "o")[rep(1:4, each = 50)] |
|
89 |
splom(~ lcrabs.pc[, 1:3], groups = crabs.grp, |
|
90 |
panel = panel.superpose, |
|
91 |
key = list(text = list(c("Blue male", "Blue female", |
|
92 |
"Orange Male", "Orange female")), |
|
93 |
points = Rows(trellis.par.get("superpose.symbol"), 1:4), |
|
94 |
columns = 4) |
|
95 |
) |
|
96 |
|
|
97 |
sex <- crabs$sex |
|
98 |
levels(sex) <- c("Female", "Male") |
|
99 |
sp <- crabs$sp |
|
100 |
levels(sp) <- c("Blue", "Orange") |
|
101 |
splom(~ lcrabs.pc[, 1:3] | sp*sex, cex = 0.5, pscales = 0) |
|
102 |
|
|
103 |
Quine <- quine |
|
104 |
levels(Quine$Eth) <- c("Aboriginal", "Non-aboriginal") |
|
105 |
levels(Quine$Sex) <- c("Female", "Male") |
|
106 |
levels(Quine$Age) <- c("primary", "first form", |
|
107 |
"second form", "third form") |
|
108 |
levels(Quine$Lrn) <- c("Average learner", "Slow learner") |
|
109 |
bwplot(Age ~ Days | Sex*Lrn*Eth, data = Quine) |
|
110 |
|
|
111 |
bwplot(Age ~ Days | Sex*Lrn*Eth, data = Quine, layout = c(4, 2), |
|
112 |
strip = function(...) strip.default(..., style = 1)) |
|
113 |
|
|
114 |
stripplot(Age ~ Days | Sex*Lrn*Eth, data = Quine, |
|
115 |
jitter = TRUE, layout = c(4, 2)) |
|
116 |
|
|
117 |
stripplot(Age ~ Days | Eth*Sex, data = Quine, |
|
118 |
groups = Lrn, jitter = TRUE, |
|
119 |
panel = function(x, y, subscripts, jitter.data = F, ...) { |
|
120 |
if(jitter.data) y <- jitter(as.numeric(y)) |
|
121 |
panel.superpose(x, y, subscripts, ...) |
|
122 |
}, |
|
123 |
xlab = "Days of absence", |
|
124 |
between = list(y = 1), par.strip.text = list(cex = 0.7), |
|
125 |
key = list(columns = 2, text = list(levels(Quine$Lrn)), |
|
126 |
points = Rows(trellis.par.get("superpose.symbol"), 1:2) |
|
127 |
), |
|
128 |
strip = function(...) |
|
129 |
strip.default(..., strip.names = c(TRUE, TRUE), style = 1) |
|
130 |
) |
|
131 |
|
|
132 |
fgl0 <- fgl[ ,-10] # omit type. |
|
133 |
fgl.df <- data.frame(type = rep(fgl$type, 9), |
|
134 |
y = as.vector(as.matrix(fgl0)), |
|
135 |
meas = factor(rep(1:9, each = 214), labels = names(fgl0))) |
|
136 |
stripplot(type ~ y | meas, data = fgl.df, |
|
137 |
scales = list(x = "free"), xlab = "", cex = 0.5, |
|
138 |
strip = function(...) strip.default(style = 1, ...)) |
|
139 |
|
|
140 |
if(F) { # no data supplied |
|
141 |
xyplot(ratio ~ scant | subject, data = A5, |
|
142 |
xlab = "scan interval (years)", |
|
143 |
ylab = "ventricle/brain volume normalized to 1 at start", |
|
144 |
subscripts = TRUE, ID = A5$ID, |
|
145 |
strip = function(factor, ...) |
|
146 |
strip.default(..., factor.levels = labs, style = 1), |
|
147 |
layout = c(8, 5, 1), |
|
148 |
skip = c(rep(FALSE, 37), rep(TRUE, 1), rep(FALSE, 1)), |
|
149 |
panel = function(x, y, subscripts, ID) { |
|
150 |
panel.xyplot(x, y, type = "b", cex = 0.5) |
|
151 |
which <- unique(ID[subscripts]) |
|
152 |
panel.xyplot(c(0, 1.5), pr3[names(pr3) == which], |
|
153 |
type = "l", lty = 3) |
|
154 |
if(which == 303 || which == 341) points(1.4, 1.3) |
|
155 |
}) |
|
156 |
} |
|
157 |
|
|
158 |
Cath <- equal.count(swiss$Catholic, number = 6, overlap = 0.25) |
|
159 |
xyplot(Fertility ~ Education | Cath, data = swiss, |
|
160 |
span = 1, layout = c(6, 1), aspect = 1, |
|
161 |
panel = function(x, y, span) { |
|
162 |
panel.xyplot(x, y); panel.loess(x, y, span) |
|
163 |
} |
|
164 |
) |
|
165 |
|
|
166 |
Cath2 <- equal.count(swiss$Catholic, number = 2, overlap = 0) |
|
167 |
Agr <- equal.count(swiss$Agric, number = 3, overlap = 0.25) |
|
168 |
xyplot(Fertility ~ Education | Agr * Cath2, data = swiss, |
|
169 |
span = 1, aspect = "xy", |
|
170 |
panel = function(x, y, span) { |
|
171 |
panel.xyplot(x, y); panel.loess(x, y, span) |
|
172 |
} |
|
173 |
) |
|
174 |
|
|
175 |
Cath |
|
176 |
levels(Cath) |
|
177 |
plot(Cath, aspect = 0.3) |
|
178 |
|
|
179 |
# End of ch04 |
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/temp.R (revision 2477) | ||
---|---|---|
1 |
|
|
2 |
postscript("temp.ps") |
|
3 |
library(lattice) |
|
4 |
|
|
5 |
|
|
6 |
## dotplot labels problem |
|
7 |
|
|
8 |
xx <- 1:10 |
|
9 |
names(xx) <- rep(letters[1:5], 2) |
|
10 |
dotplot(xx) |
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
## missing levels of factors |
|
18 |
## drop unused levels |
|
19 |
|
|
20 |
x <- 1:100 |
|
21 |
y <- rnorm(100) |
|
22 |
g <- gl(4, 25, 100) |
|
23 |
|
|
24 |
xyplot(y ~ x | g) |
|
25 |
xyplot(y ~ x | g, subset = g != "2") |
|
26 |
xyplot(y ~ x | g, subset = g != "2", |
|
27 |
panel = function(x, y, subscripts) { |
|
28 |
print(subscripts) |
|
29 |
ltext(x, y, lab = subscripts) |
|
30 |
}) |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
## subset & subscript interaction |
|
35 |
|
|
36 |
x <- rnorm(50) |
|
37 |
y <- rnorm(50) |
|
38 |
subset <- 20:40 |
|
39 |
|
|
40 |
xyplot(y ~ x, |
|
41 |
panel = function(x, y, subscripts) { |
|
42 |
print(subscripts) |
|
43 |
ltext(x, y, lab = subscripts) |
|
44 |
}) |
|
45 |
|
|
46 |
## gives subscripts = 20:40 |
|
47 |
xyplot(y ~ x, subset = subset, |
|
48 |
panel = function(x, y, subscripts) { |
|
49 |
print(subscripts) |
|
50 |
ltext(x, y, lab = subscripts) |
|
51 |
}) |
|
52 |
|
|
53 |
g <- gl(2,1,50) |
|
54 |
|
|
55 |
xyplot(y ~ x, groups = g, panel = panel.superpose) |
|
56 |
xyplot(y ~ x, groups = g, panel = panel.superpose, subset = subset) |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
## reordering tests |
|
66 |
|
|
67 |
data(iris) |
|
68 |
iris$foo <- equal.count(iris$Sepal.Length) |
|
69 |
|
|
70 |
foo <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris) |
|
71 |
|
|
72 |
foo |
|
73 |
|
|
74 |
foo$subset.cond <- list(1:3, 1:6) |
|
75 |
foo$perm.cond <- 1:2 |
|
76 |
foo |
|
77 |
|
|
78 |
foo$perm.cond <- 2:1 |
|
79 |
foo$subset.cond <- list(c(1,2,3,1), 2:4) |
|
80 |
foo |
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
bar <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris, skip = c(F, T)) |
|
85 |
bar |
|
86 |
|
|
87 |
bar <- xyplot(Petal.Length ~ Petal.Width | Species + foo, iris, skip = c(F, T), scales = "free") |
|
88 |
bar |
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
## other stuff |
|
95 |
|
|
96 |
x <- numeric(0) |
|
97 |
y <- numeric(0) |
|
98 |
|
|
99 |
bwplot(y ~ x) # fails? FIXME |
|
100 |
|
|
101 |
|
|
102 |
x <- c(rnorm(10), rep(NA, 10)) |
|
103 |
y <- gl(1, 20) |
|
104 |
a <- gl(2, 10) |
|
105 |
|
|
106 |
bwplot(x ~ y | a) |
|
107 |
|
|
108 |
|
|
109 |
## warning: why ? |
|
110 |
bwplot(x ~ y | a * a) |
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
## example from Wolfram Fischer |
|
116 |
|
|
117 |
|
|
118 |
my.barley <- subset( barley, ! ( site == "Grand Rapids" & year == "1932" ) ) |
|
119 |
|
|
120 |
dotplot(variety ~ yield | year * site, my.barley, |
|
121 |
layout=c(6,2), between=list(x=c(0,6))) |
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
dotplot(variety ~ yield | year * site, data = my.barley, |
|
126 |
layout=c(6,2), |
|
127 |
scales = |
|
128 |
list(rot = 0, |
|
129 |
y = |
|
130 |
list(relation='sliced', |
|
131 |
at = rep( list( FALSE, NULL ), 6 ))), |
|
132 |
par.settings = |
|
133 |
list(layout.widths = list(axis.panel = rep(c(1, 0), 3)))) |
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
dev.off() |
|
139 |
|
|
140 |
|
|
141 |
|
tmp/org.txm.statsengine.r.core.macosx/res/macosx/library/lattice/tests/levelplot.R (revision 2477) | ||
---|---|---|
1 |
|
|
2 |
postscript("levelplot.ps") |
|
3 |
library(lattice) |
|
4 |
|
|
5 |
data(volcano) |
|
6 |
|
|
7 |
foo <- |
|
8 |
data.frame(z = as.vector(volcano), |
|
9 |
x = rep(1:87, 61), |
|
10 |
y = rep(1:61, each = 87)) |
|
11 |
|
|
12 |
levelplot(z ~ x * y, subset(foo, z > 150), contour = T) |
|
13 |
levelplot(z ~ x * y, foo, subset = z > 150, contour = T) |
|
14 |
contourplot(z ~ x * y, foo, subset = z > 150, cuts = 10) |
|
15 |
|
|
16 |
## subset group interaction has problems (does it any longer): |
|
17 |
|
|
18 |
cloud(Sepal.Length ~ Petal.Length * Petal.Width, |
|
19 |
data = iris, cex = 0.8, groups = Species, subpanel = panel.superpose, |
|
20 |
main = "Stereo", screen = list(z = 20, x = -70, y = 0), subset = 30:60) |
|
21 |
|
|
22 |
cloud(Sepal.Length ~ Petal.Length * Petal.Width, |
|
23 |
data = iris[30:60, ], cex = 0.8, groups = Species, subpanel = panel.superpose, |
|
24 |
main = "Stereo", screen = list(z = 20, x = -70, y = 0)) |
|
25 |
|
|
26 |
|
|
27 |
levelplot(Sepal.Length ~ Petal.Length * Petal.Width, |
|
28 |
data = iris, groups = Species, |
|
29 |
subset = 30:60) |
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
cloud(z ~ x * y, foo) |
|
35 |
cloud(z ~ x * y, foo, subset = z > 150) |
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
## long format: NA's clipped at the beginning (??) |
|
40 |
|
|
41 |
splom(~iris[,1:4], iris, groups = Species) |
|
42 |
splom(~iris[,1:4], iris, groups = Species, subset = 70:130, auto.key = T) |
|
43 |
|
|
44 |
parallel(~iris[,1:4] | Species, iris, subset = 30:130) |
|
45 |
|
|
46 |
## NA-s in matrix |
|
47 |
|
|
48 |
volna <- volcano |
|
49 |
volna[20:40, 20:40] <- NA |
|
50 |
levelplot(volna) |
|
51 |
cloud(volna) |
|
52 |
wireframe(volna) |
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
dev.off() |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
# grid.newpage() |
|
62 |
# pushViewport(viewport()) |
|
63 |
# grid.lines(x = c(1:5, NA, 7:10) / 10, |
|
64 |
# y = c(1:5, NA, 7:10) / 10) |
|
65 |
|
|
66 |
# grid.points(x = c(1:5, NA, 7:10) / 10, |
|
67 |
# y = c(1:5, 6, 7:10) / 10) |
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
# grid.points(x = .5, y = .1, pch = 16, gp = gpar(cex = 1)) |
|
73 |
# grid.points(x = .5, y = .2, pch = 16, gp = gpar(cex = 3)) |
|
74 |
|
|
75 |
# grid.points(x = .5, y = .3, pch = '+', gp = gpar(cex = 1)) |
|
76 |
# grid.points(x = .5, y = .4, pch = '+', gp = gpar(cex = 3)) |
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
# viewport[ROOT] -> |
|
82 |
|
|
83 |
# (viewport[GRIDVP1182]-> |
|
84 |
|
|
85 |
# (viewport[GRIDVP1185], |
|
86 |
# viewport[GRIDVP1187], |
|
87 |
# viewport[GRIDVP1189], |
|
88 |
# viewport[GRIDVP1190], |
|
89 |
|
|
90 |
# viewport[panel.1]-> |
|
91 |
|
|
92 |
# (viewport[GRIDVP1184]-> |
|
93 |
|
|
94 |
# (viewport[subpanel.1.1], |
|
95 |
# viewport[subpanel.1.2], viewport[subpanel.1.3], |
|
96 |
# viewport[subpanel.2.1], viewport[subpanel.2.2], |
|
97 |
# viewport[subpanel.2.3], viewport[subpanel.3.1], |
|
98 |
# viewport[subpanel.3.2], viewport[subpanel.3.3])), |
|
99 |
|
|
100 |
# viewport[panel.2]-> |
|
101 |
# (viewport[GRIDVP1186]-> |
|
102 |
# (viewport[subpanel.1.1], |
|
103 |
# viewport[subpanel.1.2], viewport[subpanel.1.3], |
|
104 |
# viewport[subpanel.2.1], viewport[subpanel.2.2], |
|
105 |
# viewport[subpanel.2.3], viewport[subpanel.3.1], |
|
106 |
# viewport[subpanel.3.2], viewport[subpanel.3.3])), |
|
107 |
|
|
108 |
# viewport[panel.3]-> |
|
109 |
# (viewport[GRIDVP1188]-> |
|
110 |
# (viewport[subpanel.1.1], |
|
111 |
# viewport[subpanel.1.2], viewport[subpanel.1.3], |
|
112 |
# viewport[subpanel.2.1], viewport[subpanel.2.2], |
Formats disponibles : Unified diff