[med-svn] r23750 - in trunk/packages/R/r-bioc-aroma.light/tags: . 3.6.0-1 3.6.0-1/patches

Graham Inggs ginggs at moszumanska.debian.org
Mon May 15 12:05:45 UTC 2017


Author: ginggs
Date: 2017-05-15 12:05:45 +0000 (Mon, 15 May 2017)
New Revision: 23750

Added:
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch
Removed:
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control
   trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch
Log:
Tagged 3.6.0-1

Deleted: trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog
===================================================================
--- trunk/packages/R/r-bioc-aroma.light/trunk/debian/changelog	2017-05-15 10:55:23 UTC (rev 23742)
+++ trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog	2017-05-15 12:05:45 UTC (rev 23750)
@@ -1,38 +0,0 @@
-r-bioc-aroma.light (3.4.0-1) unstable; urgency=medium
-
-  * New upstream version
-  * Generic BioConductor homepage
-  * Switch to dh-r
-  * Versioned Build-Depends: r-cran-r.utils (>= 2.4.0)
-
- -- Andreas Tille <tille at debian.org>  Wed, 09 Nov 2016 09:40:07 +0100
-
-r-bioc-aroma.light (3.2.0-1) unstable; urgency=medium
-
-  * New upstream version
-  * cme fix dpkg-control
-  * Bump versioned (Build-)Depends: r-cran-matrixstats (>= 0.50.1)
-
- -- Andreas Tille <tille at debian.org>  Thu, 19 May 2016 16:11:47 +0200
-
-r-bioc-aroma.light (3.0.0-2) unstable; urgency=medium
-
-  * Autopkgtest would need r-cran-princurve.  Add this not yet packaged
-    R package to Suggests and remove those parts from the test suite that
-    are depending from it
-  * cme fix dpkg-control
-
- -- Andreas Tille <tille at debian.org>  Thu, 28 Apr 2016 10:52:20 +0200
-
-r-bioc-aroma.light (3.0.0-1) unstable; urgency=medium
-
-  * New upstream version
-  * Exclude tests requiring external functions
-
- -- Andreas Tille <tille at debian.org>  Sun, 08 Nov 2015 19:39:53 +0100
-
-r-bioc-aroma.light (2.4.0-1) unstable; urgency=low
-
-  * Initial release (closes: #793992)
-
- -- Andreas Tille <tille at debian.org>  Wed, 29 Jul 2015 19:59:59 +0200

Copied: trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog (from rev 23746, trunk/packages/R/r-bioc-aroma.light/trunk/debian/changelog)
===================================================================
--- trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog	                        (rev 0)
+++ trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/changelog	2017-05-15 12:05:45 UTC (rev 23750)
@@ -0,0 +1,46 @@
+r-bioc-aroma.light (3.6.0-1) unstable; urgency=medium
+
+  * New upstream version
+  * Refresh remove_test_using_external_functions.patch
+  * Bump versioned Build-Depends: r-cran-matrixstats (>= 0.52.1)
+
+ -- Graham Inggs <ginggs at debian.org>  Mon, 15 May 2017 13:14:31 +0200
+
+r-bioc-aroma.light (3.4.0-1) unstable; urgency=medium
+
+  * New upstream version
+  * Generic BioConductor homepage
+  * Switch to dh-r
+  * Versioned Build-Depends: r-cran-r.utils (>= 2.4.0)
+
+ -- Andreas Tille <tille at debian.org>  Wed, 09 Nov 2016 09:40:07 +0100
+
+r-bioc-aroma.light (3.2.0-1) unstable; urgency=medium
+
+  * New upstream version
+  * cme fix dpkg-control
+  * Bump versioned (Build-)Depends: r-cran-matrixstats (>= 0.50.1)
+
+ -- Andreas Tille <tille at debian.org>  Thu, 19 May 2016 16:11:47 +0200
+
+r-bioc-aroma.light (3.0.0-2) unstable; urgency=medium
+
+  * Autopkgtest would need r-cran-princurve.  Add this not yet packaged
+    R package to Suggests and remove those parts from the test suite that
+    are depending from it
+  * cme fix dpkg-control
+
+ -- Andreas Tille <tille at debian.org>  Thu, 28 Apr 2016 10:52:20 +0200
+
+r-bioc-aroma.light (3.0.0-1) unstable; urgency=medium
+
+  * New upstream version
+  * Exclude tests requiring external functions
+
+ -- Andreas Tille <tille at debian.org>  Sun, 08 Nov 2015 19:39:53 +0100
+
+r-bioc-aroma.light (2.4.0-1) unstable; urgency=low
+
+  * Initial release (closes: #793992)
+
+ -- Andreas Tille <tille at debian.org>  Wed, 29 Jul 2015 19:59:59 +0200

Deleted: trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control
===================================================================
--- trunk/packages/R/r-bioc-aroma.light/trunk/debian/control	2017-05-15 10:55:23 UTC (rev 23742)
+++ trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control	2017-05-15 12:05:45 UTC (rev 23750)
@@ -1,30 +0,0 @@
-Source: r-bioc-aroma.light
-Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
-Section: gnu-r
-Priority: optional
-Build-Depends: debhelper (>= 9),
-               dh-r,
-               r-base-dev,
-               r-cran-r.methodss3,
-               r-cran-matrixstats (>= 0.50.1),
-               r-cran-r.utils (>= 2.4.0)
-Standards-Version: 3.9.8
-Vcs-Browser: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/R/r-bioc-aroma.light/trunk/
-Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/R/r-bioc-aroma.light/trunk/
-Homepage: https://bioconductor.org/packages/aroma.light/
-
-Package: r-bioc-aroma.light
-Architecture: all
-Depends: ${R:Depends},
-         ${misc:Depends},
-Recommends: ${R:Recommends}
-Suggests: ${R:Suggests}
-Description: BioConductor methods normalization and visualization of microarray data
- This BioConductor module provides light-weight methods for
- normalization and visualization of microarray data using only basic R
- data types.
- .
- Methods for microarray analysis that take basic data types such as
- matrices and lists of vectors. These methods can be used standalone, be
- utilized in other packages, or be wrapped up in higher-level classes.

Copied: trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control (from rev 23745, trunk/packages/R/r-bioc-aroma.light/trunk/debian/control)
===================================================================
--- trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control	                        (rev 0)
+++ trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/control	2017-05-15 12:05:45 UTC (rev 23750)
@@ -0,0 +1,30 @@
+Source: r-bioc-aroma.light
+Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+Uploaders: Andreas Tille <tille at debian.org>
+Section: gnu-r
+Priority: optional
+Build-Depends: debhelper (>= 9),
+               dh-r,
+               r-base-dev,
+               r-cran-r.methodss3,
+               r-cran-matrixstats (>= 0.52.1),
+               r-cran-r.utils (>= 2.4.0)
+Standards-Version: 3.9.8
+Vcs-Browser: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/R/r-bioc-aroma.light/trunk/
+Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/R/r-bioc-aroma.light/trunk/
+Homepage: https://bioconductor.org/packages/aroma.light/
+
+Package: r-bioc-aroma.light
+Architecture: all
+Depends: ${R:Depends},
+         ${misc:Depends},
+Recommends: ${R:Recommends}
+Suggests: ${R:Suggests}
+Description: BioConductor methods normalization and visualization of microarray data
+ This BioConductor module provides light-weight methods for
+ normalization and visualization of microarray data using only basic R
+ data types.
+ .
+ Methods for microarray analysis that take basic data types such as
+ matrices and lists of vectors. These methods can be used standalone, be
+ utilized in other packages, or be wrapped up in higher-level classes.

Deleted: trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch
===================================================================
--- trunk/packages/R/r-bioc-aroma.light/trunk/debian/patches/remove_test_using_external_functions.patch	2017-05-15 10:55:23 UTC (rev 23742)
+++ trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch	2017-05-15 12:05:45 UTC (rev 23750)
@@ -1,246 +0,0 @@
-Author: Andreas Tille <tille at 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=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=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
-+++ b/tests/iwpca.matrix.R
-@@ -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=N)
--phi <- rep(20, length.out=N)
--xlim <- ylim <- zlim <- c(0,45);
--persp <- list();
--for (kk in seq(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(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)

Copied: trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch (from rev 23744, trunk/packages/R/r-bioc-aroma.light/trunk/debian/patches/remove_test_using_external_functions.patch)
===================================================================
--- trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch	                        (rev 0)
+++ trunk/packages/R/r-bioc-aroma.light/tags/3.6.0-1/patches/remove_test_using_external_functions.patch	2017-05-15 12:05:45 UTC (rev 23750)
@@ -0,0 +1,246 @@
+Author: Andreas Tille <tille at 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)




More information about the debian-med-commit mailing list