File: remove_test_using_external_functions.patch

package info (click to toggle)
r-bioc-aroma.light 3.28.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,384 kB
  • sloc: sh: 21; makefile: 15
file content (246 lines) | stat: -rw-r--r-- 7,293 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
Author: Andreas Tille <tille@debian.org>
Last-Update: Sun, 08 Nov 2015 19:39:53 +0100
Description: Remove test using external not packaged function
 Comment says 
  This example requires plot3d() in R.basic [http://www.braju.com/R/]
 But this URL does not exist.

--- a/tests/distanceBetweenLines.R
+++ /dev/null
@@ -1,82 +0,0 @@
-library("aroma.light")
-
-for (zzz in 0) {
-
-# This example requires plot3d() in R.basic [http://www.braju.com/R/]
-if (!require(pkgName <- "R.basic", character.only=TRUE)) break
-
-layout(matrix(1:4, nrow=2, ncol=2, byrow=TRUE))
-
-############################################################
-# Lines in two-dimensions
-############################################################
-x <- list(a=c(1,0), b=c(1,2))
-y <- list(a=c(0,2), b=c(1,1))
-fit <- distanceBetweenLines(ax=x$a, bx=x$b, ay=y$a, by=y$b)
-
-xlim <- ylim <- c(-1,8)
-plot(NA, xlab="", ylab="", xlim=ylim, ylim=ylim)
-
-# Highlight the offset coordinates for both lines
-points(t(x$a), pch="+", col="red")
-text(t(x$a), label=expression(a[x]), adj=c(-1,0.5))
-points(t(y$a), pch="+", col="blue")
-text(t(y$a), label=expression(a[y]), adj=c(-1,0.5))
-
-v <- c(-1,1)*10
-xv <- list(x=x$a[1]+x$b[1]*v, y=x$a[2]+x$b[2]*v)
-yv <- list(x=y$a[1]+y$b[1]*v, y=y$a[2]+y$b[2]*v)
-
-lines(xv, col="red")
-lines(yv, col="blue")
-
-points(t(fit$xs), cex=2.0, col="red")
-text(t(fit$xs), label=expression(x(s)), adj=c(+2,0.5))
-points(t(fit$yt), cex=1.5, col="blue")
-text(t(fit$yt), label=expression(y(t)), adj=c(-1,0.5))
-print(fit)
-
-
-############################################################
-# Lines in three-dimensions
-############################################################
-x <- list(a=c(0,0,0), b=c(1,1,1))  # The 'diagonal'
-y <- list(a=c(2,1,2), b=c(2,1,3))  # A 'fitted' line
-fit <- distanceBetweenLines(ax=x$a, bx=x$b, ay=y$a, by=y$b)
-
-xlim <- ylim <- zlim <- c(-1,3)
-dummy <- t(c(1,1,1))*100
-
-# Coordinates for the lines in 3d
-v <- seq(-10,10, by=1)
-xv <- list(x=x$a[1]+x$b[1]*v, y=x$a[2]+x$b[2]*v, z=x$a[3]+x$b[3]*v)
-yv <- list(x=y$a[1]+y$b[1]*v, y=y$a[2]+y$b[2]*v, z=y$a[3]+y$b[3]*v)
-
-for (theta in seq(30,140,length.out=3)) {
-  plot3d(dummy, theta=theta, phi=30, xlab="", ylab="", zlab="",
-                             xlim=ylim, ylim=ylim, zlim=zlim)
-
-  # Highlight the offset coordinates for both lines
-  points3d(t(x$a), pch="+", col="red")
-  text3d(t(x$a), label=expression(a[x]), adj=c(-1,0.5))
-  points3d(t(y$a), pch="+", col="blue")
-  text3d(t(y$a), label=expression(a[y]), adj=c(-1,0.5))
-
-  # Draw the lines
-  lines3d(xv, col="red")
-  lines3d(yv, col="blue")
-
-  # Draw the two points that are closest to each other
-  points3d(t(fit$xs), cex=2.0, col="red")
-  text3d(t(fit$xs), label=expression(x(s)), adj=c(+2,0.5))
-  points3d(t(fit$yt), cex=1.5, col="blue")
-  text3d(t(fit$yt), label=expression(y(t)), adj=c(-1,0.5))
-
-  # Draw the distance between the two points
-  lines3d(rbind(fit$xs,fit$yt), col="purple", lwd=2)
-}
-
-print(fit)
-
-} # for (zzz in 0)
-rm(zzz)
--- a/tests/wpca.matrix.R
+++ /dev/null
@@ -1,72 +0,0 @@
-library("aroma.light")
-
-for (zzz in 0) {
-
-# This example requires plot3d() in R.basic [http://www.braju.com/R/]
-if (!require(pkgName <- "R.basic", character.only=TRUE)) break
-
-# -------------------------------------------------------------
-# A first example
-# -------------------------------------------------------------
-# Simulate data from the model y <- a + bx + eps(bx)
-x <- rexp(1000)
-a <- c(2,15,3)
-b <- c(2,3,15)
-bx <- outer(b,x)
-eps <- apply(bx, MARGIN=2, FUN=function(x) rnorm(length(x), mean=0, sd=0.1*x))
-y <- a + bx + eps
-y <- t(y)
-
-# Add some outliers by permuting the dimensions for 1/3 of the observations
-idx <- sample(1:nrow(y), size=1/3*nrow(y))
-y[idx,] <- y[idx,c(2,3,1)]
-
-# Down-weight the outliers W times to demonstrate how weights are used
-W <- 10
-
-# Plot the data with fitted lines at four different view points
-N <- 4
-theta <- seq(0,180,length.out=N)
-phi <- rep(30, length.out=N)
-
-# Use a different color for each set of weights
-col <- topo.colors(W)
-
-opar <- par(mar=c(1,1,1,1)+0.1)
-layout(matrix(1:N, nrow=2, byrow=TRUE))
-for (kk in seq(theta)) {
-  # Plot the data
-  plot3d(y, theta=theta[kk], phi=phi[kk])
-
-  # First, same weights for all observations
-  w <- rep(1, length=nrow(y))
-
-  for (ww in 1:W) {
-    # Fit a line using IWPCA through data
-    fit <- wpca(y, w=w, swapDirections=TRUE)
-
-    # Get the first principal component
-    ymid <- fit$xMean
-    d0 <- apply(y, MARGIN=2, FUN=min) - ymid
-    d1 <- apply(y, MARGIN=2, FUN=max) - ymid
-    b <- fit$vt[1,]
-    y0 <- -b * max(abs(d0))
-    y1 <-  b * max(abs(d1))
-    yline <- matrix(c(y0,y1), nrow=length(b), ncol=2)
-    yline <- yline + ymid
-
-    points3d(t(ymid), col=col)
-    lines3d(t(yline), col=col)
-
-    # Down-weight outliers only, because here we know which they are.
-    w[idx] <- w[idx]/2
-  }
-
-  # Highlight the last one
-  lines3d(t(yline), col="red", lwd=3)
-}
-
-par(opar)
-
-} # for (zzz in 0)
-rm(zzz)
--- a/tests/iwpca.matrix.R
+++ /dev/null
@@ -1,76 +0,0 @@
-library("aroma.light")
-
-for (zzz in 0) {
-
-# This example requires plot3d() in R.basic [http://www.braju.com/R/]
-if (!require(pkgName <- "R.basic", character.only=TRUE)) break
-
-# Simulate data from the model y <- a + bx + eps(bx)
-x <- rexp(1000)
-a <- c(2,15,3)
-b <- c(2,3,4)
-bx <- outer(b,x)
-eps <- apply(bx, MARGIN=2, FUN=function(x) rnorm(length(x), mean=0, sd=0.1*x))
-y <- a + bx + eps
-y <- t(y)
-
-# Add some outliers by permuting the dimensions for 1/10 of the observations
-idx <- sample(1:nrow(y), size=1/10*nrow(y))
-y[idx,] <- y[idx,c(2,3,1)]
-
-# Plot the data with fitted lines at four different view points
-opar <- par(mar=c(1,1,1,1)+0.1)
-N <- 4
-layout(matrix(1:N, nrow=2, byrow=TRUE))
-theta <- seq(0,270,length.out=N)
-phi <- rep(20, length.out=N)
-xlim <- ylim <- zlim <- c(0,45)
-persp <- list()
-for (kk in seq_along(theta)) {
-  # Plot the data
-  persp[[kk]] <- plot3d(y, theta=theta[kk], phi=phi[kk], xlim=xlim, ylim=ylim, zlim=zlim)
-}
-
-# Weights on the observations
-# Example a: Equal weights
-w <- NULL
-# Example b: More weight on the outliers (uncomment to test)
-w <- rep(1, length(x)); w[idx] <- 0.8
-
-# ...and show all iterations too with different colors.
-maxIter <- c(seq(1,20,length.out=10),Inf)
-col <- topo.colors(length(maxIter))
-# Show the fitted value for every iteration
-for (ii in seq_along(maxIter)) {
-  # Fit a line using IWPCA through data
-  fit <- iwpca(y, w=w, maxIter=maxIter[ii], swapDirections=TRUE)
-
-  ymid <- fit$xMean
-  d0 <- apply(y, MARGIN=2, FUN=min) - ymid
-  d1 <- apply(y, MARGIN=2, FUN=max) - ymid
-  b <- fit$vt[1,]
-  y0 <- -b * max(abs(d0))
-  y1 <-  b * max(abs(d1))
-  yline <- matrix(c(y0,y1), nrow=length(b), ncol=2)
-  yline <- yline + ymid
-
-  for (kk in seq_along(theta)) {
-    # Set pane to draw in
-    par(mfg=c((kk-1) %/% 2, (kk-1) %% 2) + 1)
-    # Set the viewpoint of the pane
-    options(persp.matrix=persp[[kk]])
-
-    # Get the first principal component
-    points3d(t(ymid), col=col[ii])
-    lines3d(t(yline), col=col[ii])
-
-    # Highlight the last one
-    if (ii == length(maxIter))
-      lines3d(t(yline), col="red", lwd=3)
-  }
-}
-
-par(opar)
-
-} # for (zzz in 0)
-rm(zzz)