> 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
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
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
> 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)
> 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
> 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
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
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),
+
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
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
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
- 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.
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
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
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
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
16 matches
Mail list logo