[Rd] R CMD Sd2Rd a.sgml > a.Rd does not recognize tag (PR#8289)

2005-11-08 Thread timh
I'm trying:

R CMD Sd2Rd file.sgml > file.Rd

If file.sgml contains
x
this should be translated to
\code{x}
in the .Rd file, but is not.  
It should be treated the same as the old
x



I'm using:
Cygwin (uname gives: CYGWIN_NT-5.1) (installed 10 Oct 05)
Perl 5.8.7 build 813(installed 7 Nov 05)

--please do not edit the information below--

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

Windows XP Professional (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: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] R CMD Rdconv file.Rd --type=Ssgm \code{x} should use (PR#8290)

2005-11-08 Thread timh
I'm trying:

R CMD Rdconv file.Rd --type=Ssgm

If file.Rd contains
\code{x}
then this is currently translated as
x
I suggest instead translating to
x

(provided that R CMD Sd2Rd is changed to support the 
tag; I just submitted that bug separately).


Note that this is an enhancement, not a bug.
This change would give functionally-equivalent but prettier sgml files.


I'm using:
Cygwin (uname gives: CYGWIN_NT-5.1) (installed 10 Oct 05)
Perl 5.8.7 build 813(installed 7 Nov 05)

--please do not edit the information below--

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

Windows XP Professional (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:methods, package:stats, package:graphics, 
package:grDevices, package:utils, package:datasets, Autoloads, package:base


| Tim Hesterberg   Research Scientist  |
| [EMAIL PROTECTED]  Insightful Corp.|
| (206)802-23191700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax)  Seattle, WA 98109-3012, U.S.A.  |
|  www.insightful.com/Hesterberg   |

Download the S+Resample library from www.insightful.com/downloads/libraries

Two Research Scientist positions:
data mining
frailty/mixed effects
http://www.insightful.com/company/jobs.asp

Speak out about biased science in Washington D.C.
http://home.comcast.net/~timhesterberg/ScientificIntegrity.html

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


[Rd] R CMD Rdconv drops sections: arguments, seealso, examples (PR#9606)

2007-04-10 Thread timh
I've created a .Rd file (below), then converted that to .sgml using 
R CMD Rdconv --type=Ssgm combn.Rd  > combn.sgml
The output (shown below) is missing some of the sections:
arguments
seealso
examples
If instead I convert to .d (below), the same sections are missing,
and the "note" section is included but without the necessary newline.

--
\name{combn}
\alias{combn}
\title{ Generate combinations of m elements out of x }
\description{
  Generate all combinations of \code{m} elements out of \code{x} or
  \code{1:n}, and optionally apply a function to each, and return
  a list or simplify to a matrix or array.
}
\usage{
combn(x, m, FUN = NULL, simplify = TRUE, ...)
}
\arguments{
  \item{x}{ This is normally an integer \code{n}, in which case
combinations of elemnents from \code{1:n} are returned.
Otherwise this is a a vector, and elements of the vector are returned.
  \item{m}{ Number of elements in each combination. }
  \item{FUN}{ function to apply to each combination.  If \code{NULL},
the combinations themselves are returned, one in each column of the
result. }
  \item{simplify}{ If \code{FALSE}, the results are returned as a list,
one combination or function value in each element.  If \code{TRUE},
if possible the results are simplified to a matrix or array.
  }
  \item{\dots}{ Optional argument to pass to \code{FUN}
  }
}
\details{
  The case where \code{FUN} is supplied are handled by calling
  \code{\link{sapply}}, so \code{...}
  should not include argument to \code{\link{sapply}} -- in particular avoid
\code{X} and \code{FUN}.
}
\value{
  Normally, a matrix with \code{m} rows and \code{choose(n,m)} columns.
  If \code{simplify=FALSE} a list is returned instead, with 
  \code{choose(n,m)} elements.  If \code{FUN} is supplied then the
  results of calling the function replace the combinations.
}
\note{This is similar to the R function \code{combn}.  However,
  this version returns a list if simplification is not possible, e.g.
  because the \code{FUN} returns objects with varying lengths.
}
\seealso{ \code{\link{combinations}} is used to create the combinations.
  It is faster to call function directly (note that it gives the combinations
  in a different order).
  \code{\link{sapply}} is used when \code{FUN} is supplied.
\examples{
combn(5, 3)
combinations(5, 3)
combn(letters[1:5], 3)
combn(5, 3, simplify = FALSE)
combn(5, 3, FUN = max)
\keyword{ math }

--

]
>


  combn



Generate combinations of m elements out of x



Generate all combinations of m elements out of x or
1:n, and optionally apply a function to each, and return
a list or simplify to a matrix or array.




combn(x, m, FUN = NULL, simplify = TRUE, ...)




The case where FUN is supplied are handled by calling
sapply, so ...
should not include argument to sapply 
– in particular avoid
X and FUN.



Normally, a matrix with m rows and choose(n,m) 
columns.
If simplify=FALSE a list is returned instead, with 
choose(n,m) elements.  If FUN is supplied then the
results of calling the function replace the combinations.



This is similar to the R function combn.  However,
this version returns a list if simplification is not possible, e.g.
because the FUN returns objects with varying lengths.



math


function



--
.\" -*- nroff -*- generated from .Rd format
.de PF
,br
.ne 2
.ft 3
.nf
..
.de FP
.br
.ne 2
.ft 1
.fi
..
.BG
.FN combn
.TL
Generate combinations of m elements out of x
.DN
Generate all combinations of 'm' elements out of 'x' or
'1:n', and optionally apply a function to each, and return
a list or simplify to a matrix or array.
.CS

combn(x, m, FUN = NULL, simplify = TRUE, ...)

.RT
Normally, a matrix with 'm' rows and 'choose(n,m)' columns.
If 'simplify=FALSE' a list is returned instead, with 
'choose(n,m)' elements.  If 'FUN' is supplied then the
results of calling the function replace the combinations.
.DT
The case where 'FUN' is supplied are handled by calling
'sapply', so '\&...'
should not include argument to 'sapply' - in particular avoid
'X' and 'FUN'.Note
This is similar to the R function 'combn'.  However,
this version returns a list if simplification is not possible, e.g.
because the 'FUN' returns objects with varying lengths.

.KW math
.WR






--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 = 4.1
 year = 2006
 month = 12
 day = 18
 svn rev = 40228
 language = R
 version.string = R version 2.4.1 (2006-12-18)

Locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:combinat, package:stats, 

[Rd] help("R_LIBS") brings up the wrong help file (PR#10475)

2007-11-28 Thread timh
Doing
help("R_LIBS")
brings up a help file (the same one as help(library)),
but the help file doesn't mention R_LIBS.
It does have a link to .libPaths, which does document R_LIBS.

The quickest fix would be for help("R_LIBS") to bring up the .libPaths
help file.


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 5.0
 year = 2007
 month = 04
 day = 23
 svn rev = 41293
 language = R
 version.string = R version 2.5.0 (2007-04-23)

Windows XP (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:stats, package:graphics, package:grDevices, package:utils, 
package:datasets, package:methods, Autoloads, package:base

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


[Rd] is(x, "parent") returns FALSE when class(x) is c("child", "parent") (PR#10549)

2008-01-04 Thread timh
is() does not catch parent S3 classes:
> library(splines)
> temp <- bs(1:99, df=5)
> class(temp)
[1] "bs""basis"
> is(temp, "basis")
[1] FALSE

In contrast, is() does catch parent S4 classes:
> library(copula)
> norm.cop <- ellipCopula("normal", param = c(0.5, 0.6, 0.7),
+ dim = 3, dispstr = "un")
> is(norm.cop, "copula")
[1] TRUE
> class(norm.cop)
[1] "normalCopula"


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (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:splines, package:stats, package:graphics, 
package:grDevices, package:utils, package:datasets, package:methods, Autoloads, 
package:base

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


Re: [Rd] is(x, "parent") returns FALSE when class(x) is c("child", "parent") (PR#10549)

2008-01-07 Thread timh
In S-PLUS, is() does catch parent S3 classes.  It does not
require a setOldClass definition to do so.  I would prefer that
R work the same way, to make porting code easier.

I use is() in S-PLUS for both S3 and S4 classes because it is faster
than inherits().  I use inherits() only for testing a vector of
classes, rather than a single class.

To suggest that S3 has no class inheritance seems odd.
We use inheritance of S3 classes all the time - "ordered" inheriting
from "factor", many classes inheriting from "data.frame", etc.
I see no problem in having inheritance without class definitions.

>>>>>> "TimH" == timh  <[EMAIL PROTECTED]>
>>>>>> on Sat,  5 Jan 2008 02:05:08 +0100 (CET) writes:
>
>TimH> is() does not catch parent S3 classes:
>
>>> library(splines)
>>> temp <- bs(1:99, df=5)
>>> class(temp)
>TimH> [1] "bs""basis"
>>> is(temp, "basis")
>TimH> [1] FALSE
>
>TimH> In contrast, is() does catch parent S4 classes:
>...
>
>Yes, that's all correct, but where's the bug?
>
>S3 has *NO* class definitions, so how can there be class
>inheritance?
>There's many reasons to go from S3 to S4, and the lack of class
>definitions in S3 is an important one...
>
>Now, still being curious:  Are you implicitly saying that in S-plus,
>is() behaves differently, namely 
>``as if S3 classes would exist?'' (:-)

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


[Rd] library(splines) is missing setOldClass(c("bs", "basis")) (PR#10554)

2008-01-07 Thread timh
> library(splines)
> extends("bs", "basis")
[1] FALSE
> setOldClass(c("bs", "basis"))
> extends("bs", "basis")
[1] TRUE

Note that "bs" should inherit from "basis":
> temp <- bs(1:99, df=5)
> oldClass(temp)
[1] "bs""basis"

Similarly for "ns"

In contrast, in S+:
> extends("bs", "basis")
[1] T

--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (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:splines, package:stats, package:graphics, 
package:grDevices, package:utils, package:datasets, package:methods, Autoloads, 
package:base

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


[Rd] illegal data frame produced by [<-.data.frame (PR#10574)

2008-01-14 Thread timh
> x <- data.frame(a=1:3,b=2:4)
> x[,3] <- x
Warning message:
In `[<-.data.frame`(`*tmp*`, , 3, value = list(a = 1:3, b = 2:4)) :
  provided 2 variables to replace 1 variables
> x
  a b a.1  b.1
1 1 2   1 NULL
2 2 3   2 
3 3 4   3 
Warning message:
In format.data.frame(x, digits = digits, na.encode = FALSE) :
  corrupt data frame: columns will be truncated or padded with NAs

In S-PLUS, the first warning is given, then a legal data frame
is produced, using only the first column of value.
The following change to R's "[<-.data.frame" gives that behavior.
Change:

else if (ncolv > p) 
warning(gettextf("provided %d variables to replace %d variables", 
ncolv, p), domain = NA)

to:

else if (ncolv > p) {
warning(gettextf("provided %d variables to replace %d variables", 
ncolv, p), domain = NA)
new.cols <- new.cols[seq_len(p)]
}






--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (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:stats, package:graphics, package:grDevices, package:utils, 
package:datasets, package:methods, Autoloads, package:base

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


[Rd] extra space in: all.equal(5,6) (PR#10575)

2008-01-14 Thread timh
> all.equal(5,6)
[1] "Mean relative  difference: 0.2"

Note the odd extra space.
A fix is to change lines in all.equal.numeric from:

if (is.na(xy) || xy > tolerance) 
msg <- c(msg, paste("Mean", what, if (cplx) "Mod", "difference:", 
format(xy)))

 to:

if (cplx)
  what <- paste(what, "Mod")
if (is.na(xy) || xy > tolerance) 
msg <- c(msg, paste("Mean", what, "difference:", 
format(xy)))



--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (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:stats, package:graphics, package:grDevices, package:utils, 
package:datasets, package:methods, Autoloads, package:base

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


[Rd] Suggestions for R-intro manual (PR#10701)

2008-02-05 Thread timh
Some suggestions for R-intro:

--
Section 9.2.2, change:
(Note the function split() which produces a list of vectors obtained
by splitting a larger vector according to the classes specified by a
factor. This is a useful function, mostly used in connection with
boxplots. See the help facility for further details.)

Warning: for() loops are used in R code much less often than in
compiled languages. Code that takes a `whole object' view is
likely to be both clearer and faster in R.

to:

Warning: for() loops are used in R code much less often than in
compiled languages. Code that takes a `whole object' view is
likely to be both clearer and faster in R.

(Note the function split() which produces a list of vectors obtained
by splitting a larger vector according to the classes specified by a
factor.  It can also split data frames.  This is a useful function,
often used in combination with lapply to avoid for() loops.  See
help(split) and help(lapply) for further details.)

--
Section 10.1

The current twosam is for a pooled-variance t-statistic.
Give the unpooled version instead (for consistency with t.test,
and because it is better statistical practice).


Give initial comments in functions twosam:
# compute a two-sample t-statistic for the difference in means

and bslash:
# Compute least-squares regression coefficients (X'X)^{-}(X'y)


Add initial comments to later functions; even if they are not needed,
this sets a good example.

--
Section 11.1.1

This contains outdated information about contrasts in S-PLUS.
For version 8.0.4:
> options("contrasts")
$contrasts:
factor  ordered 
 "contr.treatment" "contr.poly"

--
Section 11.3

In this text:
predict(object, newdata=data.frame)
The data frame supplied must have variables specified with the
same labels as the original. The value is a vector or matrix of
predicted values corresponding to the

it is unclear what "labels" means - same variable names, or same
levels for factor variables.  Change
"variables specified with the same labels" to
"variables with the same names".

--
Section 11.6

There is a newer version of Dobson, 2002, second edition.

Dobson is referenced later, in Section 11.7.2.
I don't have the new copy, can't tell you new page numbers.

--
Section 12.1

Change
"High-level plotting commands always start a new plot, erasing the
current plot if necessary."
to
"High-level plotting commands start a new plot, erasing the current
plot if necessary.  This can be prevented using 'add=TRUE', see
section 12.1.4"
or
"High-level plotting commands start a new plot, erasing the current
plot if necessary."

--
Section 13.3

The last part of this sentence seems irrelevant to this section:
Packages can have namespaces, and currently all of the base and
recommended packages do expect the datasets package.

--
Appendix A

Preface comments with #.  I'm looking at the web
version of the manual, and there is nothing to distinguish
continuations of long commands from comments.
Using comments would also allow a user to paste a block
of code into R.

--

Tim Hesterberg


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (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:stats, package:graphics, package:grDevices, package:utils, 
package:datasets, package:methods, Autoloads, package:base

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


[Rd] bad variable names when printing a data frame containing a matrix (PR#10730)

2008-02-08 Thread timh
library(glmpath)
data(heart.data)
# heart.data is a list, $y a vector, $x a matrix
data <- data.frame(x=I(heart.data$x), y = heart.data$y)
> data[1:2,]
x.1   x.2   x.3   x.4   x.5   x.6   x.7   x.8   x.9 y
1   16012  5.73 23.11 149  25.3  97.252 1
2   144  0.01  4.41 28.61 055 28.87  2.0663 1
> dimnames(heart.data$x)[[2]]
[1] "sbp"   "tobacco"   "ldl"   "adiposity" "famhist"   "typea"
[7] "obesity"   "alcohol"   "age"  

Note that the printed variable names do not use the column names
of the matrix.

In contrast, in S-PLUS the names are used; the printout begins:
   x.sbp x.tobacco  x.ldl x.adiposity x.famhist x.typea x.obesity x.alcohol 


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.1
 year = 2007
 month = 11
 day = 26
 svn rev = 43537
 language = R
 version.string = R version 2.6.1 (2007-11-26)

Windows XP (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:glmpath, package:survival, package:splines, package:stats, 
package:graphics, package:grDevices, package:utils, package:datasets, 
package:methods, Autoloads, package:base

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


[Rd] apply(x, 2, mean) fails if x is a data frame containing a matrix (PR#10902)

2008-03-06 Thread timh
> data <- data.frame(a=1:5, b=I(matrix(6:15,5)))
> apply(data, 2, mean)
Error in dim(newX) <- c(prod(d.call), d2) : 
  dims [product 10] do not match the length of object [15]


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 6.2
 year = 2008
 month = 02
 day = 08
 svn rev = 44383
 language = R
 version.string = R version 2.6.2 (2008-02-08)

Windows XP (build 2600) Service Pack 2

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:stats, package:graphics, package:grDevices, package:utils, 
package:datasets, package:methods, Autoloads, package:base

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


[Rd] Problem with R CMD Rdconv -t Ssgm file.Rd > file.sgml; omits section{foo}{text} (PR#8660)

2006-03-05 Thread timh
I have a .Rd file containing a number of \section commands.
When I convert this to .sgml, the sections are missing; neither the
title nor following text is there.

In contrast, when I convert to .d, the sections are present.

R CMD Rdconv -t Ssgm temp.Rd > temp.sgml
R CMD Rdconv -t Sd temp.Rd > temp.d


Tim Hesterberg

--please do not edit the information below--

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

Windows XP Professional (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: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] Problems with R CMD Rdconv and R CMD Sd2Rd (PR#8661)

2006-03-05 Thread timh
I'm using R 2.2.0 on Windows.
Doing some conversions of help files.  Internal comments indicate
that the Sd2Rd conversion is "Converted by Sd2Rd version 1.21."

I'm converting 
.d -> .Rd   
.sgml -> .Rd
using Sd2Rd, then checking by using Rdconv to
convert .Rd back to .d or .sgml.

Here are errors in some of the conversions.
The most significant errors are in .Rd to .sgml.
The largest number of errors are in .Rd to .d (however,
this conversion is not so important).

--
.Rd to .sgml
R CMD Rdconv -t Ssgm file.Rd > file.sgml

If the .Rd contains
\section{title}{text}
the section is missing completely from the sgml file.
(I reported this separately; it works fine when converting to .d)


Similarly, \keyword{lars}
is missing completely from the sgml file
(It works fine when converting to .d)



Rd converts \$ to \$; it should be just $.  This in .Rd

\code{.Machine\$double.eps},

is converted to

.Machine\$double.eps,

It should be

.Machine$double.eps,

or better yet

.Machine$double.eps,



In \examples{}, 
<
should be converted verbatim rather than converted to 
<


In the References section (and for links more generally?), file
names are missing the .sgm
This:

\seealso{
\code{\link{lm}}
\code{\link{lsfit}}
}

is converted to:


lm
lsfit


It should be


lm
lsfit





--
.sgml to .Rd
R CMD Sd2Rd file.sgml > file.Rd

This


 lar 
least-angle regression
 lasso 
lasso method
 stepwise 
forward stepwise regression


is put verbatim into the .Rd
It should be converted into a \describe list




A references section should be converted to \references, not 
\section{References}.  This


Efron, ...


is converted to

\section{References}{
Efron, ...
}

it should be 

\references{
Efron, ...
}




--
.Rd to .d
R CMD Rdconv -t Sd file.Rd > file.d

It converts
\code{lars}
to
'lars'
It should be
`lars'


It converts (in argument list)
\item{...}{

to
.AG \&...

should be
.AG ...


Converts:
\section{Side Effects}{
A plot is produced
}

to:
.SH Side Effects
A plot is produced

should be
.SE
A plot is produced


Converts
\emph{Annals of Statistics}
\bold{32}, 407--451.

to:
_Annals of Statistics_
*32*, 407-451.

Should be:
.ul
Annals of Statistics
\fB32\fP, 407-451.


Sd2Rd converts
.PP in a .d file within the arguments section 
to
two blank lines in .Rd; 
Rdconv converts that to
.IP "" 
whereas 
.PP
would be better.


Rdconv loses comments.


This:
\value{
...
the same order of computational cost as a least squares fit.
}
\references{

is converted to (missing a newline):

the same order of computational cost as a least squares fit..SH REFERENCES


This
\name{lars.object}
\alias{lars.object}
\alias{class.lars}

is converted to
.FN lars.object

should be:
.FN lars.object
.FN class.lars


The document "Writing R Extensions" manual, chapter on
"Writing R documentation files" is silent about how to document S3 classes.
(It does mention S4 classes)


--
.d to .Rd
R CMD Sd2Rd file.d > file.Rd


A very common error when writing a .d file is to use .AG where you
should use .RC, in the .RT section, e.g.

.RT
Invisibly returns a list with components:
.AG fraction
See above
.AG cv
The CV curve at each value of fraction

Right now the converter is moving those into the "Arguments" section,
rather than leaving them in the "Value" section.  It would be nice
if they were left in the Value section.






--please do not edit the information below--

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

Windows XP Professional (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: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] Open .ssc .S ... files in R (PR#8690)

2006-03-17 Thread timh
- Quick summary:  

In the File:Open dialog, please change
"S files (*.q)" 
to
"S files (*.q, *.ssc, *.S)" 
and show the corresponding files (including .SSC and .s files).

- Background
This is motivated by the following query to R-help:

>Date: Thu, 16 Mar 2006 22:44:11 -0600
>From: "xpRt.wannabe" <[EMAIL PROTECTED]>
>Subject: [R] Is there a way to view S-PLUS script files in R
>To: r-help@stat.math.ethz.ch
>
>Dear List,
>
>I have some S-PLUS script files (.ssc).  Does there exist an R
>function/command  that can read such files?  I simply want to view the
>code and practice in R to help me learn the subject matter.
>
>Any help would be greatly appreciated.
>
>platform i386-pc-mingw32
>arch i386
>os   mingw32
>system   i386, mingw32
>status
>major2
>minor2.1
>year 2005
>month12
>day  20
>svn rev  36812
>language R

I responded:
>You can open them in R.  On Windows, File:Open Script,
>change "Files of type" to "All Files", then open the .ssc file.

So there is a workaround.  But it is odd that the "S files" option
doesn't actually include what are probably the most common S files.

Thanks,
Tim Hesterberg


--please do not edit the information below--

Version:
 platform = i386-pc-mingw32
 arch = i386
 os = mingw32
 system = i386, mingw32
 status = 
 major = 2
 minor = 2.1
 year = 2005
 month = 12
 day = 20
 svn rev = 36812
 language = R

Windows XP Professional (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:glmpath, package:survival, package:splines, 
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] comment causes browser() to exit (PR#9063)

2006-07-06 Thread timh
I'm trying to step through some code using browser(),
executing one line at a time.
Unfortunately, whenever I execute a comment line, the browser exits.

I previously reported a similar problem with blank lines.

These problems are a strong incentive to write poor code 
-- uncommented code with no blank lines to improve readability --
so that I can use browser() without it exiting at inconvenient times.

Additional detail:  
(1) I'm running R inside emacs, with R in one buffer
and a file containing code in another, using a macro to copy and paste
a line at a time from the file to the R buffer.
(2) The browser() call is inside a function.  
Right now the lines I'm sending to the browser are not part of the function,
though usually they are.


--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 Professional (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: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