Displaying 20 results from an estimated 10000 matches similar to: "labeled break statements in R?"
2004 Feb 09
5
simple question on picking out some rows of a matrix/data frame
Hi,
I have a simple question about matrix/data frame manipulation. I have
a data frame that looks a something like this
X Y Z
1 0 "apples"
-1 -1 "oranges"
...
0 -1 "bananas"
and I'd like to pull out all the rows for which X and Y are (un)equal
into a submatrix.
How can I do that?
Many thanks,
Roger Levy
2005 Mar 21
1
anomalous result for wilcox.exact in exactRankTests
Hi,
In the exactRankTest package, I've become aware that you can get
anomalous p-values (i.e., above 1) from the wilcox.exact method, as in:
> wilcox.exact(c(-0.6,0.8,-0.5))
Exact Wilcoxon signed rank test
data: c(-0.6, 0.8, -0.5)
V = 3, p-value = 1.25
alternative hypothesis: true mu is not equal to 0
This is disturbing. Has anyone encountered this before, and if so
2009 Dec 12
1
code for [[.data.frame
Hello.
I'm currently trying to wrap up data frames into OCaml via OCaml-R, and
I'm having trouble with data frame subsetting:
> # x#column 1;;
> Erreur dans (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x, :
> l'?l?ment 1 est vide ;
> la partie de la liste d'arguments de 'is.matrix' en cours d'?valuation ?tait :
> (i)
2004 Jun 14
5
terminology for frames and environments
In ?exists it says:
inherits: should the enclosing frames of the environment be searched?
I believe what it is saying is that if inherits is TRUE and it fails
to find the variable it will look in the parent environment and
the parent of the parent, etc. (as opposed to looking in the calling
frame next and the caller of the caller, etc.)
Now I thought that standard terminology in R was:
1.
2012 Jun 15
0
argument "x" is missing, with no default - Please help find argument x
R programming question, not machine learning, although that's the content.
Apologies to all for whom the following code is eye-burning. I am using
foreach() to run a simulation on a randomForest model (actually conditional
randomForest ... "party" package). The simulation is in two dimensions.
examining how "mtry" and "ntrees" are related in terms of predictive
2020 Jun 01
1
eval and Calling Frames
I ran into an interesting issue with `evalq` (and also
`eval(quote(...))`):
???? f <- function() {
?????? list(
???????? sys.parent(1),
???????? evalq(sys.parent(1)),
???????? evalq((function() sys.parent(2))()),? # add an anon fun layer
???????? evalq((function() sys.parent(1))())
?????? )
???? }
???? res <- f()
???? str(res)
???? ## List of 4
???? ##? $ : int 0???????? # sys.parent(1)
2015 Jul 15
3
bquote/evalq behavior changed in R-3.2.1
In 3.1.2 eval does not store the result of the bquote-generated call in the
given environment. Interestingly, in 3.2.1 eval does store the result of
the bquote-generated call in the given environment.
In other words if I run the given example with eval rather than evalq, on
3.1.2 "x" is never stored in "fenv," but it is when I run the same code on
3.2.1. However, the given
2007 May 27
2
Question about "evalq"
The help page of eval says: The 'evalq' form is equivalent to
'eval(quote(expr), ...)'. But the following is not equivalent. Can
anyone give me some explaination? Thanks very much.
> f1 <- function(x,digits=5) lapply(x, f2)
> f2 <- function(x) eval(quote(print(x+1,digits=digits)),list(x=x),parent.frame(2))
> f1(list(x1=1))
[1] 2
$x1
[1] 2
>
> f1 <-
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
On Jul 15, 2015, at 12:51 PM, William Dunlap wrote:
> I think rapply() was changed to act like lapply() in this respect.
>
When I looked at the source of the difference, it was that typeof() returned 'language' in 3.2.1, while it returned 'list' in the earlier version of R. The first check in rapply's code in both version was:
if (typeof(object) != "list")
2015 Jul 15
3
bquote/evalq behavior changed in R-3.2.1
Hello,
I upgraded from 3.1.2 to 3.2.1 and am receiving errors on code that worked
as I intended previously. Briefly, I am using bquote to generate
expressions to modify data.table objects within a function, so I need the
changes to actually be stored in the given environment. Previously, I used
code like the following:
test <- list(bquote(x <- 10))
fenv <- environment()
rapply(test,
2015 Jul 15
2
bquote/evalq behavior changed in R-3.2.1
David,
If you are referring to the solution that would be:
rapply(list(test), eval, envir = fenv)
I thought I explained in the question that the above code does not work. It
does not throw an error, but the behavior is no different (at least in the
output or result). Using the above code still results in the x object not
being stored in fenv on 3.1.2.
Dayne
On Wed, Jul 15, 2015 at 4:40 PM,
2001 Oct 16
4
Assignment of structures on a given environment
Hi,
In order to avoid deep copies by passing large arguments to functions or
returning values, I'm trying to do the assignment of variables in a
given environment. The problem is when I try to assign a structure: a
list for example.
If I have:
ind <- c("a","b")
my idea is doing something like
l <- alist()
l[ind] <- as.list(c(20,40))
in a given
2004 May 05
3
sample
Dear List:
I have the following simple program:
x<- sample(site)
VarGuilda1<- var(tapply(x,site,func1))
VarGuilda2<- var(tapply(x,site,func2))
VarGuilda3<- var(tapply(x,site,func3))
VarGuilda4<- var(tapply(x,site,func4))
VarGuilda5<- var(tapply(x,site,func5))
VarGuilda6<- var(tapply(x,site,func6))
VarGuilda7<- var(tapply(x,site,func7))
VarGuilda8<-
2002 Sep 04
3
strange things with eval and parent frames
Dear mailing list,
I have found some strange behaviour which I think relates to parent frames
and eval. Can anyone explain what's going on here?
First example:
> test.parent.funcs_ function() {
outer.var_ 5
subfunc1_ function() substitute( outer.var, envir=parent.frame())
print( subfunc1())
subfunc2b_ function() eval( quote( outer.var), envir=parent.frame())
print(
2004 Mar 20
2
minimum values
Hi,
In my data set I have created a matrix of distances. How can I get a list of
minimum value in each row?
thanks a lot,
Rog?rio
2015 Apr 01
4
evaluation in transform versus within
On 01/04/2015 1:35 PM, Gabriel Becker wrote:
> Joris,
>
>
> The second argument to evalq is envir, so that line says, roughly, "call
> environment() to generate me a new environment within the environment
> defined by data".
I think that's not quite right. environment() returns the current
environment, it doesn't create a new one. It is evalq() that created
2012 Nov 23
1
Constant (= wrong) historical quotes via get.hist.quote() from yahoo.finance
Dear expeRts,
I would like to download a time series of historical data from the ticker with symbol "ROG.VX". Interestingly, I obtain constant values (138.3 for each day in the chosen period) although the yahoo.finance website tells me that the time series is not at all constant. What's wrong?
Cheers,
Marius
require(tseries)
hq <- get.hist.quote(instrument="ROG.VX",
2009 Sep 23
1
Updating the Debian (and Ubuntu) packaging of Theora
Hi there, people.
On Sep 22 2009, Clint Adams wrote:
> On Tue, Sep 22, 2009 at 08:23:00PM -0300, Rog?rio Brito wrote:
> > If any of you could lend me a hand with the subject, I could make a
> > better package (the other issues that I left on the package are
> > really trivial).
>
> If you rebase your changes against bzr://bzr.debian.org/pkg-xiph/libtheora
That should
2006 Aug 31
2
Postfix won't relay after update to CentOS 4.4
Hi Everyone,
My CentOS 4.4 mail server is having problems sending mail after updating
it to 4.4 Before the update, I did not have any problems.
My ISP requires that email clients must authenticate to their mail
servers before mail can be sent out. I setup smtp auth to get postfix
to relay mail through the ISP's mail servers. Here's my config:
main.cf
--------
relayhost =
2007 Jul 04
2
Support for tags in speex files?
Dear speex developers,
Would it be possible to have tags in speex files?
I have a good amount of spoken audio (currently in MP3 format) and I
would like to convert it to speex, since it seems to be the best choice
for voice recordings.
Unfortunately, without tags, it is quite hard to identify the speeches.
Ideally, I would love if tag support were included into easytag, so that
I can manipulate