Hi,
I run in the same problem, as discussed in 2006. Is there any solution
by now?
Sigbert
Am 23.02.06 um 20:39 schrieb hadley wickham:
Did you mean that? Both are errors. Perhaps
f <- function(...) browser()
do.call(f, mtcars)
Sorry, yes, that is what I meant.
What is being used is
On Jun 25, 2013, at 6:05 PM, Dan Murphy wrote:
> My problem is to evaluate a function/model whose definition and
> parameters (I'll put x into the arguments) and other data are saved by
> someone else in an Rdata file, but I don't know the function name,
> definition or data. Nevertheless, I need
My problem is to evaluate a function/model whose definition and
parameters (I'll put x into the arguments) and other data are saved by
someone else in an Rdata file, but I don't know the function name,
definition or data. Nevertheless, I need to save whatever functional
values/model solutions are s
On 25/06/2013 11:56 AM, Dan Murphy wrote:
So the trick is to put the function f into e and define its environment to be e:
Putting f into e, and defining the environment of f to be e solve
different problems. Your toy example has both problems so it's a
reasonable solution there, but most re
So the trick is to put the function f into e and define its environment to be e:
> e <- new.env()
> e$f <- function() x^2
> environment(e$f) <- e
> e$x <- 2
> do.call("f", list(), envir = e)
[1] 4
Thanks, Duncan.
On Tue, Jun 25, 2013 at 6:49 AM, Duncan Murdoch
wrote:
> On 25/06/2013 9:32 AM, Dan
On 25/06/2013 9:32 AM, Dan Murphy wrote:
I am having difficulty understanding the envir argument of do.call.
The help page says
envir an environment within which to evaluate the call.
so I thought that in the following toy example x would be found in the
environment e and f would return 4 via
I am having difficulty understanding the envir argument of do.call.
The help page says
envir an environment within which to evaluate the call.
so I thought that in the following toy example x would be found in the
environment e and f would return 4 via do.call:
> e <- new.env()
> e$x <- 2
> f <
quot;),stringsAsFactors=FALSE)
colnames(dat1)<-"SemicolonSep_Col"
dat1
# SemicolonSep_Col
#1 13;3;18;17;14
#2 5;18;14;10;17;3
#3 6;11;8;4
#4 14;15;15;3;2;20
#5 8;18;19;17;12;11
A.K.
- Original Message -
From: Dominic Roye
To: arun
Cc:
Sent: Thursday, December 6, 2
2 "5;18;14;10;17;3"
#3 "6;11;8;4"
#4 "14;15;15;3;2;20"
#5 "8;18;19;17;12;11"
A.K.
- Original Message -
From: Dominic Roye
To: arun
Cc:
Sent: Thursday, December 6, 2012 9:33 AM
Subject: Re: [R] do.call
Well, my aim is to get a new colum
m(is.na(x))>1),],sep=";"))
#deleted rows with more than 1 NA
#[1] "13;NA;3;18;17;14" "5;18;14;10;17;3" "14;15;15;3;2;20" "8;18;19;17;12;11"
A.K.
- Original Message -
From: Dominic Roye
To: arun
Cc: R help
Sent: Thursday, Decem
<-as.data.frame(matrix(sample(c(1:20,NA),30,replace=TRUE),ncol=6))
> do.call(paste,c(na.omit(datos),sep=";"))
> #[1] "5;18;14;10;17;3" "14;15;15;3;2;20" "8;18;19;17;12;11"
>
> A.K.
>
>
>
> - Original Message -
> From: Dom
ic Roye
To: r-help@r-project.org
Cc:
Sent: Tuesday, December 4, 2012 7:38 AM
Subject: [R] do.call
Hello,
I have a problem with the "do.call-function". I would like to merge
the values of more than 30 columns, but not in all of the rows exist
values, so with this commando i get a lot of
Hello,
I have a problem with the "do.call-function". I would like to merge
the values of more than 30 columns, but not in all of the rows exist
values, so with this commando i get a lot of ";" or NA.
How get i only the merge of cells with a number?
datos$NEW <- do.call(paste, c(datos[,19:53], s
On 26/06/12 00:39, Kathie wrote:
Dear R users,
I'd like to compute X like below.
X_{i,t} = 0.1*t + 2*X_{i,t-1} + W_{i,t}
where W_{i,t} are from Uniform(0,2) and X_{i,0} = 1+5*W_{i,0}
Of course, I can do this with "for" statement, but I don't think it's good
idea because "i" and "t" are too
thanks peter. I was thinking more about t but you're right in that there's
an i there also. my
bad ( twice ).
On Mon, Jun 25, 2012 at 9:37 AM, Petr Savicky wrote:
> On Mon, Jun 25, 2012 at 05:39:45AM -0700, Kathie wrote:
> > Dear R users,
> >
> > I'd like to compute X like below.
> >
> > X_{i
On Mon, Jun 25, 2012 at 05:39:45AM -0700, Kathie wrote:
> Dear R users,
>
> I'd like to compute X like below.
>
> X_{i,t} = 0.1*t + 2*X_{i,t-1} + W_{i,t}
>
> where W_{i,t} are from Uniform(0,2) and X_{i,0} = 1+5*W_{i,0}
>
> Of course, I can do this with "for" statement, but I don't think it's
Hi Kathryn: I'm sorry because I didn't read your question carefully enough.
arima.sim won't help because you don't have a normal error term. I think
you have to loop unless someone else knows of a way that I'm not aware of.
good luck.
On Mon, Jun 25, 2012 at 8:39 AM, Kathie wrote:
> Dear R us
Hi: Use arima.sim because when you have recursive relationships like that,
there's no way to
not loop. If arima.sim doesn't allow for the trend piece (0.1*t ), then you
can do that part seperately using cumsum(0.1*(1:t)) and then add it back in
to what arima.sim gives you. I don't remember if arim
Dear R users,
I'd like to compute X like below.
X_{i,t} = 0.1*t + 2*X_{i,t-1} + W_{i,t}
where W_{i,t} are from Uniform(0,2) and X_{i,0} = 1+5*W_{i,0}
Of course, I can do this with "for" statement, but I don't think it's good
idea because "i" and "t" are too big.
So, my question is that
Is
On 12-06-08 7:06 AM, Jannis wrote:
Hi R users,
i use do.call() to run some functions on large datasets. For debugging
purposes I occasionally use browser. In the case of large datasets
supplied to do.call, this however results in R printing huge amounts of
numbers on the screen. Is there any wa
Hi R users,
i use do.call() to run some functions on large datasets. For debugging
purposes I occasionally use browser. In the case of large datasets
supplied to do.call, this however results in R printing huge amounts of
numbers on the screen. Is there any way to reduce this output?
I foun
Dear Johannes,
because myFun has an environment, and that the global environment. Look at:
with(myEnv,
{
myFun2 <- function(symbols){do.call("print", lapply(symbols, FUN=as.name))}
do.call("myFun2", list(symbols.env))
do.call("myFun", list(symbols.env))
})
Also, for example, compare
Dear all,
I'd appreciate any help to rectify what must be a misconception of mine how
environments work:
##
myEnv <- new.env()
myEnv$a.env <- 1
myEnv$symbols.env <- "a.env"
a.global <- 2
symbols.global <- "a.global"
myFun <- function(symbols){do.call("print", lapply(symb
?do.call
Second argument is a list of arguments to pass. Try do.call(mean,
list(x, na.rm = T))
On Thu, May 12, 2011 at 1:57 PM, John Kerpel wrote:
> Hi all! I need to do something really simple using do.call.
>
> If I want to call the mean function inside do.call, how do I apply the
> condition
Hi all! I need to do something really simple using do.call.
If I want to call the mean function inside do.call, how do I apply the
condition na.rm=TRUE?
So, I use do.call(mean, list(x)) where x is my data. This works fine if
there are no NAs.
Thanks,
John
[[alternative HTML version d
uesday, November 10, 2009 2:38 PM
To: Bierbryer, Andrew
Cc: r-help@r-project.org
Subject: Re: [R] do.call and timeSeries
Bierbryer, Andrew wrote:
> Does anyone know why the following code hangs on the do.call, but
works
> fine when I either comment out the require(timeSeries) or only do 2
&
Bierbryer, Andrew wrote:
Does anyone know why the following code hangs on the do.call, but works
fine when I either comment out the require(timeSeries) or only do 2
levels of a for loop instead of 3?
Thanks,
Andrew Bierbryer
require(timeSeries)
num <- 1
x.list <- l
Does anyone know why the following code hangs on the do.call, but works
fine when I either comment out the require(timeSeries) or only do 2
levels of a for loop instead of 3?
Thanks,
Andrew Bierbryer
require(timeSeries)
num <- 1
x.list <- list()
for ( i in 1:10 ) {
The help pages (here for bquote) are your friend.
I don't think you really want to do this via do.call(), as you want some
arguments evaluated and some unevaluated. Rather, match.call(), alter it
as you want, and then eval.parent it. Something like
ploteps <- function(file, plotFunction, ..
Try this:
f <- function(cmd, ...) {
cat("Hello\n")
mc <- match.call()
mc <- mc[-1]
eval.parent(mc)
cat("Goodbye\n")
}
f(plot, 1:10)
On Wed, Nov 19, 2008 at 8:57 AM, Roberto Brunelli
<[EMAIL PROTECTED]> wrote:
> I'm trying to write a simple wrapper for plot
I'm trying to write a simple wrapper for plotting functions to make
them print to postscript, something like
ploteps <- function(file, plotFunction, ...) {
args <- list(bquote(...))
# prepare postscript device
do.call(plot, args)
# close postscript device
}
I have inserted the bquote
I have a problem similar to this:
http://tolstoy.newcastle.edu.au/R/help/06/02/21987.html
If I try to debug (via browser()) and the call stack has a do.call()
call with a large data frame, R hangs for a very long time. If,
instead, replaced the do.call() call with a direct call, there is no
hang.
Thank you very much! This is exactly what I need... I did not know that there
is such a simple way :)
Antje
Peter Dalgaard schrieb:
> Antje wrote:
>> Hello,
>>
>> I have a vector containing strings of simple operation methods.
>>
>> methods <- c("mean","sd","median")e.g.
>>
>> Now, I'd like
Antje wrote:
> Hello,
>
> I have a vector containing strings of simple operation methods.
>
> methods <- c("mean","sd","median")e.g.
>
> Now, I'd like to apply these methods to my data and I thought, I could make a
> do.call. But these methods don't need any further arguments... Do I have to
Hello,
I have a vector containing strings of simple operation methods.
methods <- c("mean","sd","median")e.g.
Now, I'd like to apply these methods to my data and I thought, I could make a
do.call. But these methods don't need any further arguments... Do I have to
create an empty argument l
35 matches
Mail list logo