[Distr-commits] r579 - in branches/distr-2.2/pkg: . SweaveListingUtils/chm
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 9 14:38:00 CEST 2009
Author: ruckdeschel
Date: 2009-09-09 14:37:59 +0200 (Wed, 09 Sep 2009)
New Revision: 579
Added:
branches/distr-2.2/pkg/qqplot.R
Modified:
branches/distr-2.2/pkg/SweaveListingUtils/chm/0SweaveListingUtils-package.html
branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingOptions.html
branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingUtils.chm
branches/distr-2.2/pkg/SweaveListingUtils/chm/library.html
branches/distr-2.2/pkg/SweaveListingUtils/chm/setToBeDefinedPkgs.html
Log:
some html's
+ sketch file for qqplot for objects of class distribution; @Matthias: pls check!
Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/0SweaveListingUtils-package.html
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/chm/0SweaveListingUtils-package.html 2009-09-04 17:40:03 UTC (rev 578)
+++ branches/distr-2.2/pkg/SweaveListingUtils/chm/0SweaveListingUtils-package.html 2009-09-09 12:37:59 UTC (rev 579)
@@ -133,7 +133,7 @@
<p>
To this end commands
<code><a href="library.html">library</a></code> and
-<code><a href="require.html">require</a></code> are masked. See also
+<code><a href="library.html">require</a></code> are masked. See also
<code><a href="lstsetLanguage.html">lstsetLanguage</a></code>,
<code><a href="changeKeywordstyles.html">changeKeywordstyles</a></code>,
and <code><a href="setToBeDefinedPkgs.html">setToBeDefinedPkgs</a></code>
Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingOptions.html
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingOptions.html 2009-09-04 17:40:03 UTC (rev 578)
+++ branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingOptions.html 2009-09-09 12:37:59 UTC (rev 579)
@@ -191,7 +191,7 @@
<h3>See Also</h3>
-<p><code><a onclick="findlink('base', 'options.html')" style="text-decoration: underline; color: blue; cursor: hand">options</a></code>, <code><a onclick="findlink('base', 'getOption.html')" style="text-decoration: underline; color: blue; cursor: hand">getOption</a></code></p>
+<p><code><a onclick="findlink('base', 'options.html')" style="text-decoration: underline; color: blue; cursor: hand">options</a></code>, <code><a onclick="findlink('base', 'options.html')" style="text-decoration: underline; color: blue; cursor: hand">getOption</a></code></p>
<h3>Examples</h3>
Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingUtils.chm
===================================================================
(Binary files differ)
Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/library.html
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/chm/library.html 2009-09-04 17:40:03 UTC (rev 578)
+++ branches/distr-2.2/pkg/SweaveListingUtils/chm/library.html 2009-09-09 12:37:59 UTC (rev 579)
@@ -49,7 +49,7 @@
<table summary="R argblock">
<tr valign="top"><td><code>package, help</code></td>
<td>
-the name of a package, given as a <a href="../../base/html/name.html">name</a> or
+the name of a package, given as a <a onclick="findlink('base', 'name.html')" style="text-decoration: underline; color: blue; cursor: hand">name</a> or
literal character string, or a character string, depending on
whether <code>character.only</code> is <code>FALSE</code> (default) or
<code>TRUE</code>).</td></tr>
@@ -59,7 +59,7 @@
loaded package. Note that <code>.First.lib</code> may attach other
packages, and <code>pos</code> is computed <EM>after</EM> <code>.First.lib</code>
has been run. Can also be the name of a position on the current
-search list as given by <code><a href="../../base/html/search.html">search</a>()</code>.</td></tr>
+search list as given by <code><a onclick="findlink('base', 'search.html')" style="text-decoration: underline; color: blue; cursor: hand">search</a>()</code>.</td></tr>
<tr valign="top"><td><code>lib.loc</code></td>
<td>
a character vector describing the location of <font face="Courier New,Courier" color="#666666"><b>R</b></font>
@@ -82,7 +82,7 @@
<tr valign="top"><td><code>warn.conflicts</code></td>
<td>
logical. If <code>TRUE</code>, warnings are
-printed about <code><a href="../../base/html/conflicts.html">conflicts</a></code> from attaching the new
+printed about <code><a onclick="findlink('base', 'conflicts.html')" style="text-decoration: underline; color: blue; cursor: hand">conflicts</a></code> from attaching the new
package, unless that package contains an object
<code>.conflicts.OK</code>. A conflict is a function masking a function,
or a non-function masking a non-function.
@@ -91,7 +91,7 @@
<td>
logical. If <code>TRUE</code>, functions
‘keep their source’ including comments, see argument
-<code>keep.source</code> to <code><a href="../../base/html/options.html">options</a></code>. This applies only to
+<code>keep.source</code> to <code><a onclick="findlink('base', 'options.html')" style="text-decoration: underline; color: blue; cursor: hand">options</a></code>. This applies only to
the named package, and not to any packages or name spaces which might be
loaded to satisfy dependencies or imports.
</p>
@@ -113,15 +113,17 @@
logical or environment. If <code>TRUE</code>, a call to
<code>require</code> from the source for a package will save the name of
the required package in the variable <code>".required"</code>, allowing
-function <code><a href="../../base/html/detach.html">detach</a></code> to warn if a required package is
+function <code><a onclick="findlink('base', 'detach.html')" style="text-decoration: underline; color: blue; cursor: hand">detach</a></code> to warn if a required package is
detached. See section ‘Packages that require other packages’ below.</td></tr>
+
<tr valign="top"><td><code>inSweave</code></td>
<td>
shall the command show Sweave behaviour (no startup messages;
instead issuing new symbols for <code>morekeywords</code> tag in
language definition of <font face="Courier New,Courier" color="#666666"><b>R</b></font> in TeX package ‘<span class="file">listings</span>’)?
By default argument is taken from
-<code><a href="../../SweaveListingUtils/html/SweaveListingOptions.html">getSweaveListingOption</a></code>.</td></tr>
+<code></code>.</td></tr>
+
<tr valign="top"><td><code>keywordstyles</code></td>
<td>
character or missing or <code>NULL</code>; added argument in masked
@@ -131,6 +133,7 @@
(to be found with <code>ls()</code>). Remember that special characters like \
have to be escaped. If missing, a special strategy is used to get
sensible value (see details).</td></tr>
+
<tr valign="top"><td><code>interm.keywordstyles</code></td>
<td>
character or missing or <code>NULL</code>; added argument in masked
@@ -142,12 +145,13 @@
<code>intermediate</code> is <code>TRUE</code>. Remember that special characters like \
have to be escaped. If missing, a special strategy is used to get
sensible value (see details).</td></tr>
+
<tr valign="top"><td><code>overwrite</code></td>
<td>
logical or missing or <code>NULL</code>; added argument in masked
versions of <code>library</code> and <code>require</code> of package
<span class="pkg">SweaveListingUtils</span>; if missing, the corresponding global option is read
-out by <code><a href="../../SweaveListingUtils/html/SweaveListingOptions.html">getSweaveListingOption</a></code>. Let us call the corresponding
+out by <code></code>. Let us call the corresponding
possibly imputed value <EM>effective</EM> value. If this effective value is
<code>TRUE</code>, before registering a new symbol for TeX package 'listings',
we first check whether this symbol had already been registered in
@@ -156,16 +160,18 @@
<code>.keywordsR</code>] and if so do not include the symbol once again; if the value is <code>FALSE</code>,
no matter of the original language definition all symbols to be found by <code>ls()</code>
are registered and hence typeset in the corresponding package-keywordstyle.</td></tr>
+
<tr valign="top"><td><code>intermediate</code></td>
<td>
logical or missing or <code>NULL</code>; added argument in masked
versions of <code>library</code> and <code>require</code> of package
<span class="pkg">SweaveListingUtils</span>; if missing, the corresponding global option is read
-out by <code><a href="../../SweaveListingUtils/html/SweaveListingOptions.html">getSweaveListingOption</a></code>. If the effective value is
+out by <code></code>. If the effective value is
<code>TRUE</code>, also the symbols to be found in newly, automatically loaded
packages (loaded, because the required/"library"-ed package features them
in its corresponding <code>Depends</code> field in its DESCRIPTION file)
are registered for TeX package 'listings'.</td></tr>
+
</table>
@@ -176,7 +182,7 @@
versions in package <span class="pkg">base</span>. This masking is necessary to allow for
extra arguments <code>keywordstyles</code>, <code>interm.keywordstyles</code>,
<code>overwrite</code>, <code>intermediate</code>. Hence please confer
-<code><a href="../../base/html/library.html">library</a></code>, <code><a href="../../base/html/require.html">require</a></code>.<br>
+<code><a onclick="findlink('base', 'library.html')" style="text-decoration: underline; color: blue; cursor: hand">library</a></code>, <code><a onclick="findlink('base', 'library.html')" style="text-decoration: underline; color: blue; cursor: hand">require</a></code>.<br>
</p>
<p>
If argument <code>inSweave</code> is <code>FALSE</code> or if argument
@@ -199,7 +205,7 @@
and if so use its corresponding keywordstyle; else we use option
<code>Keywordstyles</code> resp. <code>interm.Keywordstyles</code> (which we get
by <code>getSweaveListingOption</code>). New entries in the global variable
-<code>.tobeDefinedPkgs</code> may be appended by <code><a href="../../SweaveListingUtils/html/setToBeDefinedPkgs.html">setToBeDefinedPkgs</a></code>.<br>
+<code>.tobeDefinedPkgs</code> may be appended by <code></code>.<br>
</p>
<p>
</p>
@@ -211,7 +217,7 @@
before and after this call we also get hand on the intermediate packages,
which are automatically attached packages by dependence. After this call
we register the new symbols by corresponding calls to
-<code><a href="../../SweaveListingUtils/html/lstsetLanguage.html">lstsetLanguage</a></code>.
+<code></code>.
</p>
<p>
For use in an <code>.Rnw</code> file, the call to <code>require</code> or <code>library</code>
@@ -254,7 +260,7 @@
<h3>See Also</h3>
<p>
-<code><a href="../../base/html/library.html">library</a></code>.
+<code><a onclick="findlink('base', 'library.html')" style="text-decoration: underline; color: blue; cursor: hand">library</a></code>.
</p>
Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/setToBeDefinedPkgs.html
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/chm/setToBeDefinedPkgs.html 2009-09-04 17:40:03 UTC (rev 578)
+++ branches/distr-2.2/pkg/SweaveListingUtils/chm/setToBeDefinedPkgs.html 2009-09-09 12:37:59 UTC (rev 579)
@@ -1,10 +1,10 @@
<html><head><title>setToBeDefinedPkgs</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="Rchm.css">
-</head>
-<body>
+</head><body>
-<table width="100%"><tr><td>setToBeDefinedPkgs(SweaveListingUtils)</td><td align="right">R Documentation</td></tr></table><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
+<table width="100%"><tr><td>setToBeDefinedPkgs(SweaveListingUtils)</td><td align="right">R Documentation</td></tr></table>
+<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="keyword" value="R: setToBeDefinedPkgs">
<param name="keyword" value=" setToBeDefinedPkgs">
</object>
@@ -16,8 +16,7 @@
<h3>Description</h3>
<p>
-sets up / updates a table of keywordstyles to different packages
-</p>
+sets up / updates a table of keywordstyles to different packages</p>
<h3>Usage</h3>
@@ -43,6 +42,7 @@
</td></tr>
</table>
+
<h3>Details</h3>
<p>
@@ -51,7 +51,7 @@
</p>
<p>
It is used afterwords by the masked versions of
-<code><a href="require.html">require</a></code> and
+<code><a href="library.html">require</a></code> and
<code><a href="library.html">library</a></code> of this package to allow for
defining a set of keywordstyle formats for different packages
right in the preamble of a ‘<span class="file">.Rnw</span>’ file.
@@ -68,13 +68,13 @@
<h3>Value</h3>
<p>
-<code>invisible()</code></p>
+<code>invisible()</code>
+</p>
+
<h3>Author(s)</h3>
-<p>
-Peter Ruckdeschel <a href="mailto:Peter.Ruckdeschel at itwm.fraunhofer.de">Peter.Ruckdeschel at itwm.fraunhofer.de</a>
-</p>
+<p>Peter Ruckdeschel <a href="mailto:Peter.Ruckdeschel at itwm.fraunhofer.de">Peter.Ruckdeschel at itwm.fraunhofer.de</a></p>
<h3>Examples</h3>
@@ -87,8 +87,15 @@
print(SweaveListingUtils:::.tobeDefinedPkgs)
</pre>
+<script Language="JScript">
+function findlink(pkg, fn) {
+var Y, link;
+Y = location.href.lastIndexOf("\\") + 1;
+link = location.href.substring(0, Y);
+link = link + "../../" + pkg + "/chtml/" + pkg + ".chm::/" + fn;
+location.href = link;
+}
+</script>
-
-<hr><div align="center">[Package <em>SweaveListingUtils</em> version 0.3 <a href="00Index.html">Index</a>]</div>
-
+<hr><div align="center">[Package <em>SweaveListingUtils</em> version 0.4 <a href="00Index.html">Index</a>]</div>
</body></html>
Added: branches/distr-2.2/pkg/qqplot.R
===================================================================
--- branches/distr-2.2/pkg/qqplot.R (rev 0)
+++ branches/distr-2.2/pkg/qqplot.R 2009-09-09 12:37:59 UTC (rev 579)
@@ -0,0 +1,228 @@
+################################################################
+# QQ - Plot for distribution objects
+# yet to be documented and ranged into distr, distrMod, RobAStBase
+################################################################
+
+
+## into distr
+if(!isGeneric("qqplot"))
+ setGeneric("qqplot", function(x, y, ...) standardGeneric("qqplot"))
+
+## into distr
+setMethod("qqplot", signature(x="ANY",y="ANY"), function(x, y,
+ plot.it = TRUE, xlab = deparse(substitute(x)),
+ ylab = deparse(substitute(y)), ...){
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ if(missing(xlab)) mc$xlab <- xlab
+ if(missing(ylab)) mc$ylab <- ylab
+ mcl <- as.list(mc)[-1]
+ do.call(stats::qqplot, args=mcl)
+ return(invisible())
+ })
+
+## into distr
+
+## helper
+
+.confqq <- function(p,D,alpha,col,lty,n){
+ x <- q(D)(p)
+ ppq <- sqrt(p*(1-p))
+ dp <- d(D)(x)
+ alphan <- alpha^(1/n)
+ qa <- qnorm((1+alphan)/2)
+ lines(x, x+qa*ppq/dp/sqrt(n), col=col,lty=lty)
+ lines(x, x-qa*ppq/dp/sqrt(n), col=col,lty=lty)
+}
+setMethod("qqplot", signature(x = "UnivariateDistribution",
+ y = "UnivariateDistribution"), function(x, y,
+ n = 30, withIdLine = TRUE, withPwConf = TRUE,
+ plot.it = TRUE, xlab = deparse(substitute(x)),
+ ylab = deparse(substitute(y)), ...,
+ col.IdL = "red", lty.IdL = 2, alpha.IdL = .95){
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
+ if(missing(ylab)) mc$ylab <- as.character(deparse(mc$y))
+ mcl <- as.list(mc)[-1]
+ pp <- ppoints(n)
+ xc <- q(x)(pp)
+ yc <- q(y)(pp)
+ mcl$x <- xc
+ mcl$y <- yc
+ mcl$n <- NULL
+ ret <- do.call(stats::qqplot, args=mcl)
+ if(withIdLine){
+ abline(0,1,col=col.IdL,lty=lty.IdL)
+ if(is(yD,"AbscontDistribution") && withPwConf){
+ xy <- sort(c(xc,yc))
+ .confqq(p(yD)(xy),yD,alpha.IdL,col.IdL,lty.IdL,length(xy))
+ }
+ }
+ return(ret)
+ })
+
+
+## into distrMod
+setMethod("qqplot", signature(x = "ANY",
+ y = "UnivariateDistribution"), function(x, y,
+ n = 30, withIdLine = TRUE, withPwConf = TRUE,
+ plot.it = TRUE, xlab = deparse(substitute(x)),
+ ylab = deparse(substitute(y)), ...,
+ col.IdL = "red", lty.IdL = 2, alpha.IdL = .95){
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
+ if(missing(ylab)) mc$ylab <- as.character(deparse(mc$y))
+ mcl <- as.list(mc)[-1]
+ pp <- ppoints(n)
+ yc <- q(y)(pp)
+ mcl$y <- yc
+ mcl$n <- NULL
+ ret <- do.call(stats::qqplot, args=mcl)
+ if(withIdLine){
+ abline(0,1,col=col.IdL,lty=lty.IdL)
+ if(is(yD,"AbscontDistribution") && withPwConf){
+ xy <- sort(c(x,yc))
+ .confqq(p(yD)(xy),yD,alpha.IdL,col.IdL,lty.IdL,length(xy))
+ }
+ }
+ return(ret)
+ })
+
+## into distrMod
+setMethod("qqplot", signature(x = "ANY",
+ y = "ProbFamily"), function(x, y,
+ n = 30, withIdLine = TRUE, withPwConf = TRUE,
+ plot.it = TRUE, xlab = deparse(substitute(x)),
+ ylab = deparse(substitute(y)), ...,
+ col.IdL = "red", lty.IdL = 2, alpha.IdL = .95){
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
+ if(missing(ylab)) mc$ylab <- as.character(deparse(mc$y))
+ mcl <- as.list(mc)[-1]
+ pp <- ppoints(n)
+ yD <- y at distribution
+ if(!is(yD,"UnivariateDistribution"))
+ stop("Not yet implemented.")
+ yc <- q(yD)(pp)
+ mcl$y <- yc
+ mcl$n <- NULL
+ ret <- do.call(stats::qqplot, args=mcl)
+
+ if(withIdLine){
+ abline(0,1,col=col.IdL,lty=lty.IdL)
+ if(is(yD,"AbscontDistribution") && withPwConf){
+ xy <- sort(c(x,yc))
+ .confqq(p(yD)(xy),yD,alpha.IdL,col.IdL,lty.IdL,length(xy))
+ }
+ }
+
+ return(ret)
+ })
+
+## hier muss noch die Distanz besser gewählt werden:
+
+## into RobAStBase
+setMethod("qqplot", signature(x = "ANY",
+ y = "RobModel"), function(x, y,
+ n = length(x), withIdLine = TRUE, withPwConf = TRUE,
+ plot.it = TRUE, xlab = deparse(substitute(x)),
+ ylab = deparse(substitute(y)), ...,
+ col.IdL = "red", lty.IdL = 2, alpha.IdL = .95,
+ distance = NormType()){
+
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
+ if(missing(ylab)) mc$ylab <- as.character(deparse(mc$y))
+ mcl <- as.list(mc)[-1]
+
+ pp <- ppoints(n)
+ yD <- y at center@distribution
+ if(!is(yD,"UnivariateDistribution"))
+ stop("Not yet implemented.")
+ yc <- q(yD)(pp)
+
+ lenx <- n
+ leny <- length(x)
+
+ x <- sort(x)
+
+ if (leny < lenx)
+ x <- approx(1L:lenx, x, n = leny)$y
+ if (leny > lenx)
+ yc <- approx(1L:leny, yc, n = lenx)$y
+
+ xD <- fct(distance)(x)
+ x.cex <- 3/(1+log(1+xD))
+
+ mcl$x <- x
+ mcl$y <- yc
+ mcl$n <- NULL
+ mcl$cex <- x.cex
+
+ ret <- do.call(stats::qqplot, args=mcl)
+
+ if(withIdLine){
+ abline(0,1,col=col.IdL,lty=lty.IdL)
+ if(is(yD,"AbscontDistribution") && withPwConf){
+ xy <- sort(c(x,yc))
+ .confqq(p(yD)(xy),yD,alpha.IdL,col.IdL,lty.IdL,length(xy))
+ }
+ }
+
+ return(ret)
+ })
+
+## into RobAStBase
+setMethod("qqplot", signature(x = "ANY",
+ y = "InfRobModel"), function(x, y,
+ n = length(x), withIdLine = TRUE, withPwConf = TRUE,
+ plot.it = TRUE, xlab = deparse(substitute(x)),
+ ylab = deparse(substitute(y)), ...,
+ col.IdL = "red", lty.IdL = 2, alpha.IdL = .95,
+ distance = NormType()){
+
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ if(missing(xlab)) mc$xlab <- as.character(deparse(mc$x))
+ if(missing(ylab)) mc$ylab <- as.character(deparse(mc$y))
+ mcl <- as.list(mc)[-1]
+
+ pp <- ppoints(n)
+ yD <- y at center@distribution
+ if(!is(yD,"UnivariateDistribution"))
+ stop("Not yet implemented.")
+ yc <- q(yD)(pp)
+
+ lenx <- n
+ leny <- length(x)
+
+ x <- sort(x)
+
+ if (leny < lenx)
+ x <- approx(1L:lenx, x, n = leny)$y
+ if (leny > lenx)
+ yc <- approx(1L:leny, yc, n = lenx)$y
+
+
+ L2D <- L2deriv(y at center)
+ FI <- FisherInfo(y at center)
+ L2Dx <- sapply(x, function(x) evalRandVar(L2D,x)[[1]])
+ scx <- solve(sqrt(FI),L2Dx)
+ xD <- fct(distance)(scx)
+ x.cex <- 3/(1+log(1+xD))
+
+ mcl$x <- x
+ mcl$y <- yc
+ mcl$n <- NULL
+ mcl$cex <- x.cex
+
+ ret <- do.call(stats::qqplot, args=mcl)
+
+ if(withIdLine){
+ abline(0,1,col=col.IdL,lty=lty.IdL)
+ if(is(yD,"AbscontDistribution") && withPwConf){
+ xy <- sort(c(x,yc))
+ .confqq(p(yD)(xy),yD,alpha.IdL,col.IdL,lty.IdL,length(xy))
+ }
+ }
+
+ return(ret)
+ })
More information about the Distr-commits
mailing list