I have hit a problem with the design of the mcmc package I can't
figure out, possibly because I don't really understand the R function
call mechanism. The function metrop in the mcmc package has a ... argument
that it passes to one or two user-supplied functions, which are other
arguments to
On 06/09/2009 1:50 PM, Charles Geyer wrote:
I have hit a problem with the design of the mcmc package I can't
figure out, possibly because I don't really understand the R function
call mechanism. The function metrop in the mcmc package has a ... argument
that it passes to one or two
I am using try. I have found that sometimes errors are not caught by
try. For example, I got the following error message from code that was
wrapped in try. After the error, my R CMD BATCH aborted.
Error in assign(.target, met...@target, envir = envir) :
no function to return from, jumping
Why does the following show a class attribute of character when
using the interpreter:
x - data.frame(hat=1:10)
class(rownames(x)) ## returns [1] character
but when called from c/cpp, the rownames attribute has no class
attribute, and is in fact a vector of INTSXP?
On Mar 17, 2009, at 16:45 , Whit Armstrong wrote:
Why does the following show a class attribute of character when
using the interpreter:
x - data.frame(hat=1:10)
class(rownames(x)) ## returns [1] character
but when called from c/cpp, the rownames attribute has no class
attribute
Note
ivo...@gmail.com wrote:
Gentlemen---these are all very clever workarounds, but please forgive me
for voicing my own opinion: IMHO, returning multiple values in a
statistical language should really be part of the language itself. there
should be a standard syntax of some sort, whatever it
mark.braving...@csiro.au wrote:
The syntax for returning multiple arguments does not strike me as
particularly appealing. would it not possible to allow syntax like:
f= function() { return( rnorm(10), rnorm(20) ) }
(a,d$b) = f()
FWIW, my own solution is to define a
Why? Can you demonstrate any situations where its useful? Despite
having my own facility for this I've found that over the years I
have never used it.
On Sat, Mar 7, 2009 at 9:23 AM, ivo...@gmail.com wrote:
Gentlemen---these are all very clever workarounds, but please forgive me for
voicing
Gentlemen---these are all very clever workarounds, but please forgive me
for voicing my own opinion: IMHO, returning multiple values in a
statistical language should really be part of the language itself. there
should be a standard syntax of some sort, whatever it may be, that everyone
hi gabor: this would be difficult to do. I don't think you want to
read my programs. it would give you an appreciation of what ugly
horror programs end users can write in the beautiful R language ;-).
clearly, one can work around the lack of such a feature.
multiple-return values are syntax
On Sat, Mar 7, 2009 at 9:38 AM, ivo welch ivo...@gmail.com wrote:
hi gabor: this would be difficult to do. I don't think you want to
read my programs. it would give you an appreciation of what ugly
horror programs end users can write in the beautiful R language ;-).
clearly, one can work
ivo...@gmail.com wrote:
Gentlemen---these are all very clever workarounds,
hacks around the lack of a feature
but please forgive me for voicing my own opinion: IMHO, returning
multiple values in a statistical language should really be part of the
language itself.
returning multiple values
On Sat, Mar 7, 2009 at 10:26 AM, Wacek Kusnierczyk
waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
ivo...@gmail.com wrote:
Gentlemen---these are all very clever workarounds,
hacks around the lack of a feature
but please forgive me for voicing my own opinion: IMHO, returning
multiple values in
Gabor Grothendieck wrote:
On Sat, Mar 7, 2009 at 9:38 AM, ivo welch ivo...@gmail.com wrote:
hi gabor: this would be difficult to do. I don't think you want to
read my programs. it would give you an appreciation of what ugly
horror programs end users can write in the beautiful R language
Gabor Grothendieck wrote:
as gabor says in another post, you probably should first show why having
multiple value returns would be useful in r. however, i don't think
there are good counterarguments anyway, and putting on you the burden of
proving a relatively obvious (or not so?) thing is a
On Sat, Mar 7, 2009 at 11:37 AM, Wacek Kusnierczyk
waclaw.marcin.kusnierc...@idi.ntnu.no wrote:
Gabor Grothendieck wrote:
as gabor says in another post, you probably should first show why having
multiple value returns would be useful in r. however, i don't think
there are good
One idea of program design is that users
should be protected against themselves.
It is my experience that users, especially
novices, tend to over-split items rather than
over-clump items. The fact that items are
returned by the same function call would
argue to me that there is a connection
Patrick Burns wrote:
One idea of program design is that users
should be protected against themselves.
It is my experience that users, especially
novices, tend to over-split items rather than
over-clump items. The fact that items are
returned by the same function call would
argue to me that
Gabor Grothendieck wrote:
I've provided an argument against it and no one has provided one
for it. The so-called identical code Ivo showed was not identical
and, in fact, was flawed.
no, you're wrong. you think of the part where ivo shows what he'd like
to have; the example i was
Gabor Grothendieck wrote:
- this still does not allow one to use the names directly, only as
L$first etc., with the syntactic and semantic (longer lookup times) penalty;
That's how it should be done. Using the auto split you get many
variables which is not desirable. it encourages bad
Thomas Petzoldt wrote:
Patrick Burns wrote:
One idea of program design is that users
should be protected against themselves.
... and r coherently implements this idea :]
It is my experience that users, especially
novices, tend to over-split items rather than
over-clump items. The fact
-project.org] On Behalf
Of Gabor Grothendieck [ggrothendi...@gmail.com]
Sent: 06 March 2009 09:25
To: ivo welch
Cc: r-devel@r-project.org
Subject: Re: [Rd] question
I posted this a few years ago (but found I never really had a
need for it):
http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html
I posted this a few years ago (but found I never really had a
need for it):
http://tolstoy.newcastle.edu.au/R/help/04/06/1430.html
On Thu, Mar 5, 2009 at 9:22 AM, ivo welch ivo...@gmail.com wrote:
dear R developers: it is of course easy for a third party to make
suggestions if this third
M. wrote:
Hello,
I have a matrix with value varying from -1 to 1. I hope to use scaled color
based on its value to produce an image of this matrix.
Suppose I hope to label those data in [-1,-0.5] with blue, label those
[-0.5,0.8] with light blue (tone is proportional to its value) and label
Hello,
I have a matrix with value varying from -1 to 1. I hope to use scaled color
based on its value to produce an image of this matrix.
Suppose I hope to label those data in [-1,-0.5] with blue, label those
[-0.5,0.8] with light blue (tone is proportional to its value) and label
those [0.8,1]
Hi All,
I am using R-2.7.0 and am trying to Understand the memory Manager in it.
I am a bit confused about The Node Classes .Can Any one explain?
*R-Internals states that
---
*The `small' vector nodes -- Class 1 to Class 6-- are able to store vector
data of up to 8,
Hello all,
I hope I have found the right place for my question.
There are different kinds of p-values for one-sided and two-sided
tests, for example mid p-value [1], minimum-likelihood p-value [2] or
conditional two-sided p-value [3].
I tried to find out what kind of p-value is implemented in R
Hi, Simon all, I try to embed R in my win32 multiple threads program and get
c stack error.I have tried to disable the stack limit by setting R_CStackLimit
to -1.However, if I do this in R source code \src\gnuwin32\system.c (in
functionR_SetWin32(Rstart Rp), after line R_CStackLimit = top -
Dear R-devel,
Apologies for sending what is probably a very simple question to R-devel: I am
definitely missing something very simple and can't work out what it is. I've
been trying to find the problem here for about a month and need some help!
I am trying to work out how to run a C program
Since you are using Borland C++, the examples in the online complement to
'S Programming' are relevant, as is README.packages.
Basically, you have not managed to export any entry points, and to do so
you will need to make a DLL and not a .exe.
*However* it is much easier to make use of the
Dear r-devel members,
I encountered a C stack limit issue, when I tried to embed R 2.5 into my
application. In the R-exts document, it says:Note that R's own front ends
use a stack size of 10Mb. I desire to know: is it possible to decrease this
stack size
by modifying R's source code? If it's
On Fri, 1 Jun 2007, Ev Whin wrote:
Dear r-devel members,
I encountered a C stack limit issue, when I tried to embed R 2.5 into my
application. In the R-exts document, it says:Note that R's own front ends
use a stack size of 10Mb. I desire to know: is it possible to decrease this
stack
On Jun 1, 2007, at 5:44 AM, Ev Whin wrote:
Dear r-devel members,
I encountered a C stack limit issue, when I tried to embed R
2.5 into my
application.
If you are embedding R, you can change or disable the stack limit by
setting R_CStackLimit appropriately. There is no need to change
On Fri, 1 Jun 2007, Simon Urbanek wrote:
On Jun 1, 2007, at 5:44 AM, Ev Whin wrote:
Dear r-devel members,
I encountered a C stack limit issue, when I tried to embed R
2.5 into my
application.
If you are embedding R, you can change or disable the stack limit by
setting R_CStackLimit
Hi r-devel,
The R_ParseVector has been changed in R-2.5.0, and there is a simple
description about the 4th argument at
http://stat.ethz.ch/R-manual/R-patched/NEWS, it says that:
R_ParseVector() has a new 4th argument 'SEXP srcfile' allowing source
references to be attached to the returned
Ev Whin wrote:
Hi r-devel,
The R_ParseVector has been changed in R-2.5.0, and there is a simple
description about the 4th argument at
http://stat.ethz.ch/R-manual/R-patched/NEWS, it says that:
R_ParseVector() has a new 4th argument 'SEXP srcfile' allowing source
references to be attached to
The help files for delayedAssign and substitute both say that
substitute() can be used to see the expression associated with a
promise. However, I can't see how to do that. When I try the example
in help file for delayedAssign I don't see substitute() extracting the
promise, e.g.:
msg -
On 2/13/2007 1:34 PM, Tony Plate wrote:
The help files for delayedAssign and substitute both say that
substitute() can be used to see the expression associated with a
promise. However, I can't see how to do that. When I try the example
in help file for delayedAssign I don't see
I'm trying to add arguments to the AIC method
for some classes -- things like
weights=TRUE to calculate AIC weights
corr=TRUE, nobs to calculate AICc
delta=TRUE to put a delta-AIC column in the output.
The problem is that AIC is defined as
AIC(object, ..., k=2) where k is the constant
I don't see how this can work, in S3 or S4. Callers of AIC are entitied
to expect it to behave as described on the help page, and so to be able to
pass objects called (e.g.) 'delta' and get back exactly the value
mentioned.
For what you seem to want to do, I think you need your own generic.
Ben Bolker [EMAIL PROTECTED] writes:
I'm trying to add arguments to the AIC method
for some classes -- things like
weights=TRUE to calculate AIC weights
corr=TRUE, nobs to calculate AICc
delta=TRUE to put a delta-AIC column in the output.
The problem is that AIC is defined as
He wants to specify arguments to AIC that act like the k argument
and is thinking of faking it by, essentially, doing another round of
argument matching on ...
I think that if you define an S4 generic that only dispatches on the
first argument you may be able to do it for a specific method. On
Duncan Murdoch [EMAIL PROTECTED] writes:
substitute(function(a=a) 1, list(a=quote(foo)))
function(a = a) 1
a bug for sure
Yes.
Hmm... The issue is that the argument to `function` is a pairlist (not
LANGSXP), and we don't recurse into those. Any R object can turn up as
part of
Hi,
Can someone help me understand why
substitute(function(a) a + 1, list(a=quote(foo)))
gives
function(a) foo + 1
and not
function(foo) foo + 1
The man page leads me to believe this is related to lazy evaluation of
function arguments, but I'm not getting the big picture.
Thanks,
+
On 9/14/2006 3:01 PM, Seth Falcon wrote:
Hi,
Can someone help me understand why
substitute(function(a) a + 1, list(a=quote(foo)))
gives
function(a) foo + 1
and not
function(foo) foo + 1
The man page leads me to believe this is related to lazy evaluation of
function
On Thu, 14 Sep 2006, Duncan Murdoch wrote:
I think it's the same reason that this happens:
substitute(c( a = 1, b = a), list(a = quote(foo)))
c(a = 1, b = foo)
The a in function(a) is the name of the arg, it's not the arg itself
(which is missing). Now a harder question to answer is why
Duncan Murdoch wrote:
On 9/14/2006 3:01 PM, Seth Falcon wrote:
Hi,
Can someone help me understand why
substitute(function(a) a + 1, list(a=quote(foo)))
gives
function(a) foo + 1
and not
function(foo) foo + 1
The man page leads me to believe this is related to lazy
On Thu, 14 Sep 2006, Robert Gentleman wrote:
substitute(c( a = 1, b = a), list(a = quote(foo)))
c(a = 1, b = foo)
The a in function(a) is the name of the arg, it's not the arg itself
yes, but the logic seems to be broken. In Seth's case there seems to be
no way to use substitute to
On 9/14/2006 3:49 PM, Robert Gentleman wrote:
Duncan Murdoch wrote:
On 9/14/2006 3:01 PM, Seth Falcon wrote:
Hi,
Can someone help me understand why
substitute(function(a) a + 1, list(a=quote(foo)))
gives
function(a) foo + 1
and not
function(foo) foo + 1
The man page leads
On Tue, 9 May 2006, Berwin A Turlach wrote:
Dear all,
I was recently contacted by a user about an alledged problem/bug in
the latest version of lasso2. After some investigation, we found out
that it was a user error which boils down to the following:
x - matrix(rnorm(200), ncol=2)
var -
Dear all,
I was recently contacted by a user about an alledged problem/bug in
the latest version of lasso2. After some investigation, we found out
that it was a user error which boils down to the following:
x - matrix(rnorm(200), ncol=2)
var - fred
apply(x, 2, var)
Error in get(x, envir,
Berwin A Turlach wrote:
G'day all,
I spend today sometime playing around with R under Windows since our
lecturing starts in 2 weeks again and our IT guys want to know which
version to put onto our lab machines.
I noticed the following:
Under R-2.2.1, I obtain the following output:
Erich == Erich Neuwirth [EMAIL PROTECTED]
on Sun, 02 Oct 2005 09:39:36 +0200 writes:
Erich The following code
Erich zzz-1:10
Erich dim(zzz)-10
Erich rownames(zzz)
Erich colnames(zzz)
Erich yields NULL for the rownames and colnames calls.
Erich Let us set
On Mon, 3 Oct 2005, Martin Maechler wrote:
Erich == Erich Neuwirth [EMAIL PROTECTED]
on Sun, 02 Oct 2005 09:39:36 +0200 writes:
Erich The following code
Erich zzz-1:10
Erich dim(zzz)-10
Erich rownames(zzz)
Erich colnames(zzz)
Erich yields NULL for the rownames and
BDR == Prof Brian Ripley [EMAIL PROTECTED]
on Mon, 3 Oct 2005 09:44:47 +0100 (BST) writes:
BDR On Mon, 3 Oct 2005, Martin Maechler wrote:
Erich == Erich Neuwirth [EMAIL PROTECTED]
on Sun, 02 Oct 2005 09:39:36 +0200 writes:
Erich The following code
Erich zzz-1:10
The following code
zzz-1:10
dim(zzz)-10
rownames(zzz)
colnames(zzz)
yields NULL for the rownames and colnames calls.
Let us set rownames
rownames(zzz)-1:10
Now rownames(zzz) returns the expected result, but colnames(zzz)
produces an error:
Error in dn[[2]] : subscript out of bounds
So given a
Hi,
My package caMassClass depends on several other packages, one of them
PROcess residing on Bioconductor website. Bioconductor repository is
not, listed in default set of repositories in current version of R (Windows
R 2.1.1). As a result people installing my package have to change that
Tuszynski, Jaroslaw W writes:
Hi,
My package caMassClass depends on several other packages, one of them
PROcess residing on Bioconductor website. Bioconductor repository is
not, listed in default set of repositories in current version of R (Windows
R 2.1.1). As a result people installing my
SET_LENGTH is in Rdefines.h (you did not say). It is a wrapper for
x = lengthgets(x, n)
and that will do what you want. HOWEVER, you have changed x and the
object it points to, so you do need to worry about re-protection.
So, I think that macro is rather dangerous (and it is not the
201 - 259 of 259 matches
Mail list logo