Displaying 20 results from an estimated 7000 matches similar to: "Plot can't forget bad parameters"
2005 Aug 18
2
Use of contains in S4 classes
setClass("B", representation=representation("B", extra="numeric))
setClass("B", representation=representation(extra="numeric"),
contains="B")
Are these the same? If not, how do they differ?
What about
setClass("B", representation=representation("B", extra="numeric"),
contains="B")
?
As far as I can
2004 Feb 07
2
R does in memory analysis only?
I wonder if someone would confirm something I'm 99% sure of from the
docs and discussion on the list, but can't find stated explicitly:
R works only on problems that fit into (real or virtual) memory.
Thus, even if you have a problem (e.g., simple regression) that could be
solved by doing some operation on each row of a dataset at a time, you
can't solve it unless the entire dataset
2005 Jun 02
1
Too generic with S4 methods?
I tried the following (relevant excerpt only)
setMethod("likelihood",
signature(spec="Specification", covs="vector",
states="vector"),
function(spec, covs, states) {
####
setMethod("likelihood",
signature(model="Model", path="matrix"),
function(model, path) {
This
2003 Oct 30
4
packaging a package addon
I am trying to package some code that is a tweak to the survival
package. When I asked earlier, the list consensus was that it would be
best to do this as a separate package, dependent on survival.
This is proving a bit tricky.
I have some run-time and compile time concerns.
Run-time, my R code needs R code from survival, and my C code needs C
functions from survival. Will this all be
2003 May 06
1
Seeking packaging advice
I have 3 questions about creating a package for R, and would appreciate
any guidance.
1. Demonstrating the packaged code requires some support code files. It
would seem natural to put these in the demo directory, but "Writing R
extensions" says files in demo should be suitable for runing from
demo(). The support files are not intended to be run from the top
level. How should I handle
2003 Nov 05
1
Contributing to the R Extensions documentation
I thought there were some gaps in the R Extensions document; in
particular, I was left wondering how to create a list. I think a
paragraph on it would be useful.
I would be happy to contribute the paragraph, but I'm not sure if
there's interest or what the procedure is. Can anyone advise me?
Though I was looking at the 1.7.0 version, I just checked 1.8.0 and the
relevant section seems
2005 Aug 18
1
problem with repeated formal arguments and ...
I want to add an argument if it is not present. Following the Green
Book, p. 337:
test <- function(x, ...){
dots <- list(...)
if (!hasArg(from))
from <- 0
else
from <- dots$from
curve(x, from=from, ...)
}
> test(sin)
> test(sin, from=4)
Error in curve(x, from = from, ...) : formal argument "from" matched by
multiple actual arguments
The FAQ says, in
2004 Mar 24
1
snow documentation comments
There are a few points I found unclear or unmentioned in the snow
documentation (mostly I looked at the cluster.html web page). I thought
I'd mention them here.
What is the start up environment for the children?
--------------------------------------------------
My best guess at the answer is in parentheses
Do they inherit shell variables? (no)
Do they inherit variables set in R or other
2004 Aug 20
2
Error messages and C
I am calling a C (C++ really) function via the .C interface.
Sometimes when things go wrong I want to return an error message.
1. R provides C functions error and warning which look about right.
But exactly how does this exit, and in particular what happens with
cleaning up, calling C++ destructors, and unwinding the stack? Will I
get memory leaks?
2. Before I discovered those functions, I
2003 Jul 17
3
Looking to maximize a conditional likelihood
I want to maximize a conditional likelihood function that is basically
logistic conditional on the number of successes within strata. What
would be a good starting place for this? A complication is that the
denominator includes a term that is the sum over all permutations.
Although there is no time dimension to the problem, it's possible a
degenerate use of the Cox proportional hazards
2004 Dec 09
1
Calling R a la carte?
I have written an R package, mostly implemented in C++. It works.
I want to do unit tests of the C++ code, as well as higher level tests
from R. I use the boost test framework for this, part of which is a
library which wants to be the thing that starts everything running
(i.e., main).
My code has a few invocations of R functions--just error at the moment,
I think. The list might grow. So I
2005 May 23
2
Documentation of S3 and S4 classes, inheritance
I'd like to have a class A that computes a likelihood, and a subclass B
that computes the same likelihood by sometimes throws in an additional
term (B includes measurement error).
So B's likelihood needs to call A's, and then (sometimes) multiply by an
additional term.
It sounds as if, in the S3 scheme, NextMethod is supposed to do this:
like.A <- function(stuff) compute value
2004 Aug 20
1
R CMD check testing environment
I can't tell from the docs ("Writing R Extensions" 1.9.1) exactly what
environment the tests, examples, and vignettes that R CMD check tries to
run are in.
In particular:
1) how do I get the package loaded?
2) how do I access data in the data/ directory?
3) where is the material in the other directories? (e.g., has inst/
material been installed? where?)
Apparently (section 1.3)
2003 Nov 01
0
html glitches with help?
Looking at the html generated help pages for a package I'm working on, I
noticed a couple of things that looked a little funny. I suspect they
are general features of the html for R (I don't usually look at it).
First is a problem of vertical alignment in tables. The first column
consistently aligned vertically *below* the alignment line of the bottom
line of the second column. This was
2003 Nov 04
1
Architecting an optimization with external calls
I have a likelihood I would like to compute using C++ and then
optimize. It has data that need to persist across individual calls to
the likelihood. I'd appreciate any recommendations about the best way
to do this. There are several, related issues.
1. Use the R optimizer or a C optimizer?
Because of the persistence problems (see below), using a C optimizer has
a certain attraction.
2003 Sep 12
1
glitch in terms documentation (PR#4146)
These are two small items that caught my eye.
I'm looking at the R 1.7.1 2003-06-16 pdf reference manual. There are
several refences to terms.default (e.g., p. 711, 712) but no definitions
of it. I'm guessing this means terms, but it's a little puzzling.
Also, the desription of terms.object does not mention that the
"variables" attribute is actually a list of
2004 Nov 09
0
Is nesting {} inside \eqn OK?
I'm seeing various things fail when I try to next braces inside \eqn.
This source
\eqn{{\bf\beta}_j}{b(j)} is the vector
produces this error
----------------------------------------------
[4]
! Missing $ inserted.
<inserted text>
$
l.258 \eqn{{\bf\beta}_j}{\bf\beta}_
j{{b(j)} is the vector of
coefficients fo...
I've inserted a
2003 May 19
0
R CMD check creates a syntax error
Using R Version 1.6.2 (2003-01-10) I did R CMD check. The package I
was checking includes an .Rd file with an example.
My package test directory included a file foo-Ex.R whose first line was
WARNING: ignoring environment value of R_HOME
There are some problems with this:
1. R_HOME is not set.
2. The line is a syntax error, causing the test to fail.
Furthermore, I got this warning message a
2003 Aug 26
2
Seeking Packaging advice
I have two questions about packaging up code.
1) Weave/tangle advisable?
In the course of extending some C code already in S, I had to work out
the underlying math. It seems to me useful to keep this information
with the code, using Knuth's tangle/weave type tools. I know there is
some support for this in R code, but my question is about the wisdow of
doing this with C (or Fortran, or other
2003 Jun 03
2
Question about looking up names
I think I now understand how R looks up names. Could anyone tell me if
I have this right?
First it looks up the nested environments created by lexical scoping.
Then, if it gets to the top (.GlobalEnv) it also looks through the list
of things that have been "attach"ed.
It never looks in the call stack unless you explicitly ask it to, or
mess with the environment frames.
The reason I