[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 = i

[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 0

[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 connec

[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)

[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

[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

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

2008-01-07 Thread timh
ance 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) >>&g

[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), +

[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 i

[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

[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

[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.

[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 .sgm

[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 > tem

[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 i

[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 bu