Re: [Rd] Documentation bug?

2023-02-14 Thread Sebastian Meyer

Thanks. The note is indeed outdated since at least R 2.9.0 with NEWS

o   predict.lm() now works correctly when the fit had more than
one offset (possibly specified both in the formula and as an
argument).  This function is called by predict.glm(), so the
same isses are corrected there.

It has now been removed from ?lm in r83832 in the trunk (ported to 
R-patched).


Sebastian Meyer


Am 14.02.23 um 09:31 schrieb GILLIBERT, Andre via R-devel:

Dead R developers,

In R-devel  2023-02-11 and older R versions, there is a note in the "lm 
{stats}" help page specifying that:

Offsets specified by offset will not be included in predictions by 
predict.lm, whereas those 
specified by an offset term in the formula will be.


However, the source code as well as basic tests seem to show that both types of 
offset terms are always used in predictions.
a<-data.frame(off=1:4, outcome=4:1)
mod<-lm(data=a, outcome~1, offset=off)
coef(a) # intercept is zero
predict(mod) # returns 1:4, which uses offset
predict(mod, newdata=data.frame(off=c(3,2,5))) # returns c(3,2,5) which uses 
the new offset

When looking at the history of R source code, this note seems to exist from R 
1.0.0 while the source code of predict.lm already called 
eval(object$call$offset, newdata)
https://github.com/SurajGupta/r-source/blob/1.0.0/src/library/base/R/lm.R
https://github.com/SurajGupta/r-source/blob/1.0.0/src/library/base/man/lm.Rd

Version 0.99.0 did not contain the note, but already had the call to 
eval(object$call$offset, newdata)
https://github.com/SurajGupta/r-source/blob/0.99.0/src/library/base/man/lm.Rd
https://github.com/SurajGupta/r-source/blob/0.99.0/src/library/base/R/lm.R

The actual behavior of R seems to be sane to me, but unless I miss something, 
this looks like a documentation bug.
It seems to have bugged someone before:
https://stackoverflow.com/questions/71264495/why-is-predict-not-ignoring-my-offset-from-a-poisson-model-in-r-no-matter-how-i

Digging deeper in R history, it seems that this note was also found in "glm {stats}" in R 
1.0.0 but was removed in R 1.4.1. Maybe somebody forgot to remove it in "lm {stats}" too.

--
Sincerely
Andr� GILLIBERT

[[alternative HTML version deleted]]


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Documentation bug?

2023-02-14 Thread GILLIBERT, Andre via R-devel
Dead R developers,

In R-devel  2023-02-11 and older R versions, there is a note in the "lm 
{stats}" help page specifying that:
> Offsets specified by offset will not be included in predictions by 
> predict.lm, whereas 
> those specified by an offset term in the formula will be.

However, the source code as well as basic tests seem to show that both types of 
offset terms are always used in predictions.
a<-data.frame(off=1:4, outcome=4:1)
mod<-lm(data=a, outcome~1, offset=off)
coef(a) # intercept is zero
predict(mod) # returns 1:4, which uses offset
predict(mod, newdata=data.frame(off=c(3,2,5))) # returns c(3,2,5) which uses 
the new offset

When looking at the history of R source code, this note seems to exist from R 
1.0.0 while the source code of predict.lm already called 
eval(object$call$offset, newdata)
https://github.com/SurajGupta/r-source/blob/1.0.0/src/library/base/R/lm.R
https://github.com/SurajGupta/r-source/blob/1.0.0/src/library/base/man/lm.Rd

Version 0.99.0 did not contain the note, but already had the call to 
eval(object$call$offset, newdata)
https://github.com/SurajGupta/r-source/blob/0.99.0/src/library/base/man/lm.Rd
https://github.com/SurajGupta/r-source/blob/0.99.0/src/library/base/R/lm.R

The actual behavior of R seems to be sane to me, but unless I miss something, 
this looks like a documentation bug.
It seems to have bugged someone before:
https://stackoverflow.com/questions/71264495/why-is-predict-not-ignoring-my-offset-from-a-poisson-model-in-r-no-matter-how-i

Digging deeper in R history, it seems that this note was also found in "glm 
{stats}" in R 1.0.0 but was removed in R 1.4.1. Maybe somebody forgot to remove 
it in "lm {stats}" too.

--
Sincerely
Andr� GILLIBERT

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Documentation bug in kruskal.test (PR#10404)

2007-11-08 Thread bornkamp
Full_Name: Björn Bornkamp
Version: 2.6.0
OS: Windows XP
Submission from: (NULL) (129.217.207.144)


The literature reference in the documentation for the function kruskal.test is:

Myles Hollander & Douglas A. Wolfe (1973), Nonparametric statistical inference.
New York: John Wiley & Sons. Pages 115–120. 

But I believe it should be

Myles Hollander & Douglas A. Wolfe (1973), Nonparametric statistical methods.
New York: John Wiley & Sons. Pages 115–120. 

There is a different book from Jean Gibbons called "Nonparametric statistical
inference", but I believe it does not describe the corrected Kruskal Wallis test
statistic, when there are ties in the data...

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] documentation bug for isoreg example (PR#10352)

2007-10-19 Thread maechler
> "BT" == Benjamin Tyner <[EMAIL PROTECTED]>
> on Thu, 18 Oct 2007 15:15:06 +0200 (CEST) writes:

BT> Full_Name: Benjamin Tyner
BT> Version: 2.6.0 (43063)
BT> OS: WinXP
BT> Submission from: (NULL) (171.161.224.10)


BT> At the end of the examples for isoreg, there is

BT> cat("R^2 =", formatC(sum(residuals(ir4)^2) / (9*var(y4)), 
digits=2),"\n")

BT> I think this should be

BT> cat("R^2 =", formatC(1 - sum(residuals(ir4)^2) / (9*var(y4)), 
digits=2),"\n"

I think so too, and I'm infinitely embarrassed because I think I
had put that example there {maybe cut & paste from somewhere,
but still...}

Martin Maechler, ETH Zurich.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] documentation bug for isoreg example (PR#10352)

2007-10-18 Thread btyner
Full_Name: Benjamin Tyner
Version: 2.6.0 (43063)
OS: WinXP
Submission from: (NULL) (171.161.224.10)


At the end of the examples for isoreg, there is

   cat("R^2 =", formatC(sum(residuals(ir4)^2) / (9*var(y4)), digits=2),"\n")

I think this should be

   cat("R^2 =", formatC(1 - sum(residuals(ir4)^2) / (9*var(y4)), digits=2),"\n"

Thanks
Ben

platform   i386-pc-mingw32 
arch   i386
os mingw32 
system i386, mingw32   
status 
major  2   
minor  6.0 
year   2007
month  10  
day03  
svn rev43063   
language   R   
version.string R version 2.6.0 (2007-10-03)

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Documentation bug: Section 3.3.2 of R-Lang. (PR#9928)

2007-09-26 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote:
> Full_Name: Simeon Bird
> Version: 2.5.1
> OS: Linux
> Submission from: (NULL) (131.111.200.200)
>
>
> In the manual "The R Language Definition", section 3.3.2 reads:
>
> "3.3.2 Propagation of names
>
> propagation of names (first one wins, I think - also if it has no names?? —–
> first one *with names* wins, recycling causes shortest to lose names)"
>
> I'm not really sure what this is talking about.
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>   
Several bits of the document have that kind of "proto-text" style and
need to be rephrased in ordinary English.

What that particular paragraph was meant to describe is this:

> c(A=1)+c(b=2)
A
3
> c(A=1)+c(b=2,c=3)
b c
3 4
> c(1)+c(b=2)
b
3


-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Documentation bug: Section 3.3.2 of R-Lang. (PR#9928)

2007-09-26 Thread S . P . Bird
Full_Name: Simeon Bird
Version: 2.5.1
OS: Linux
Submission from: (NULL) (131.111.200.200)


In the manual "The R Language Definition", section 3.3.2 reads:

"3.3.2 Propagation of names

propagation of names (first one wins, I think - also if it has no names?? —–
first one *with names* wins, recycling causes shortest to lose names)"

I'm not really sure what this is talking about.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Documentation bug for sys.parent

2007-04-16 Thread Jeffrey Horner
In R-trunk version 41191, the 'Value' section of sys.parent.Rd explains 
that sys.parent() returns an environment, which is wrong. The 'Details' 
sections explains that it returns the number of the parent frame, etc. 
Here's a fix:

Index: src/library/base/man/sys.parent.Rd
===
--- src/library/base/man/sys.parent.Rd  (revision 41191)
+++ src/library/base/man/sys.parent.Rd  (working copy)
@@ -81,8 +81,8 @@
  }
  \value{
\code{sys.call} returns a call, \code{sys.function} a function
-  definition, and \code{sys.frame}, \code{sys.parent} and
-  \code{parent.frame} return an environment.
+  definition, and \code{sys.frame} and \code{parent.frame} return an
+  environment.

For the other functions, see the Details section.
  }

Best,

Jeff
-- 
http://biostat.mc.vanderbilt.edu/JeffreyHorner

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] documentation bug as S-Plus catches up (PR#8933)

2006-06-03 Thread maechler
> "RMH" == Richard M Heiberger <[EMAIL PROTECTED]>
> on Sat,  3 Jun 2006 01:31:48 +0200 (CEST) writes:

RMH> # R for Windows will not send your bug report
RMH> automatically.  # Please copy the bug report (after
RMH> finishing it) to # your favorite email program and send
RMH> it to # # [EMAIL PROTECTED] #
RMH> ##

RMH> The R documentation for "is.R" says "## 'which()' only
RMH> exists in R:" This is no longer true.  In S-Plus 8.0

>> version
RMH> Enterprise Developer Version 8.0.1 Beta 1 for Microsoft
RMH> Windows : 2006


RMH> both "is.R" and "which" are defined in the splus
RMH> directory.

Thank you, Rich, for the update.

Note however that this is a *beta* version of S-plus,
that I'd guess 95--99.5% of S-plus users are *not* using currently.
Here, ETH has been paying a site licence for S-plus for many
years, but we haven't been able to even use S-plus 7.x, because
of problems that seem to make it impossible that the ETH-central licence server
can continued to be used for S+7 (given the current IT
infrastructure & staff).


RMH> Now that coordination with R, including use of the
RMH> package system, is one of the Insightful goals, I hope
RMH> someone in R-core will be monitoring these changes.
[who were you hoping for ? ;-)]

RMH> Let me know if you want me to post these types of
RMH> things in the future.  I won't unless specically
RMH> requested.

I'd say we are thankful if you continue to do so,
to R-devel typically rather than R-bugs,
particularly in border cases like the current one.

Martin

RMH> Rich

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] documentation bug as S-Plus catches up (PR#8933)

2006-06-02 Thread rmh
# R for Windows will not send your bug report automatically.
# Please copy the bug report (after finishing it) to
# your favorite email program and send it to
#
#   [EMAIL PROTECTED]
#
##

The R documentation for "is.R" says
 "## 'which()' only exists in R:"
This is no longer true.  In S-Plus 8.0

> version
Enterprise Developer Version 8.0.1 Beta 1  for Microsoft Windows : 2006 

both "is.R" and "which" are defined in the splus directory.


Now that coordination with R, including use of the package system, is one of
the Insightful goals, I hope someone in R-core will be monitoring these changes.
Let me know if you want me to post these types of things in the future.
I won't unless specically requested.

Rich

--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 3.1
 year = 2006
 month = 06
 day = 01
 svn rev = 38247
 language = R
 version.string = Version 2.3.1 (2006-06-01)

Windows XP Home Edition (build 2600) Service Pack 2.0

Locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

Search Path:
 .GlobalEnv, package:grid, package:lattice, 
file:c:/HOME/rmh/h2/library/H2/.RData, 
file:c:/HOME/rmh/hh/splus.library/HH/.RData, package:car, package:Rcmdr, 
package:tcltk, 
package:methods, package:stats, package:graphics, package:grDevices, 
package:utils, 
package:datasets, RcmdrEnv, Autoloads, package:base

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Documentation bug in complex.Rd (PR#8218)

2005-10-19 Thread berwin
Dear all,

I noticed a documentation error in complex.Rd.  A patch that corrects
the error is as follows:

[bossiaea:R-devel-src]$ svn diff
Index: src/library/base/man/complex.Rd
===
--- src/library/base/man/complex.Rd (revision 35935)
+++ src/library/base/man/complex.Rd (working copy)
@@ -52,7 +52,8 @@
   complex values. Modulus and argument are also called the \emph{polar
   coordinates}. If \eqn{z = x + i y} with real \eqn{x} and \eqn{y},
   \code{Mod}\eqn{(z) = \sqrt{x^2 + y^2}}, and for
-  \eqn{\phi= Arg(z)}, \eqn{x = \cos(\phi)} and \eqn{y = \sin(\phi)}.
+  \eqn{\phi= \code{Arg}(z)}, \eqn{x = \code{Mod}(z)\cos(\phi)} and
+  \eqn{y = \code{Mod}(z)\sin(\phi)}.
   They are all generic functions: methods can be defined
   for them individually or via the \code{\link{Complex}} group generic.

Cheers,

Berwin

--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 2
 minor = 2.0
 year = 2005
 month = 10
 day = 06
 svn rev = 35749
 language = R

Locale:
C

Search Path:
 .GlobalEnv, package:methods, package:stats, package:graphics, 
package:grDevices, package:utils, package:datasets, Autoloads, package:base

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Documentation bug in libPaths.Rd (PR#8050)

2005-08-04 Thread Weigand . Stephen
The Details section of the help for .Library / .libPaths 
has:

  "the library search path is set to the
  existing files in 'unique(new, .Library)' 
  and this is returned."

I think 'unique(new, .Library)' should be be changed 
to 'unique(c(new, .Library))'.

Thank you,

Stephen

platform sparc-sun-solaris2.9
arch sparc   
os   solaris2.9  
system   sparc, solaris2.9   
status   
major2   
minor1.0 
year 2005
month04  
day  18  
language R

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel