Displaying 20 results from an estimated 148 matches for "unevaluated".
2005 Oct 13
1
Getting ... as an unevaluated list
Hi,
I'm trying to get ...as a list of unevaluated arguments, ie.
substitute(list(...)) gives me an unevaluated list of the arguments,
but I want a list of the unevaluated arguments.
My attempts so far:
(function(...) substitute(...))(a=1, b=a) # Only returns first
(function(...) substitute(list(...)))(a=1, b=a) # Unevaluated list,
not list of...
2010 Mar 02
2
turn character string into unevaluated R object
Hi,
How to turn a character string into an unevaluated R object? I want to load some files in a directory into data matrix R objects. I could do this with read.table and assign (see below). Then, I want to turn the character string representing a file name (the evaluated expression of i) into an unevaluated R object. Basically, I want to create matrice...
2010 Oct 18
1
paste an unevaluated expression
...ate an expression without evaluating it. Then paste
that expression to an object. Example:
Result <- paste('Result', 1, sep="")
paste(Result, substitute(apply(exp.des[1:10,], 1, one.row,
parms=parameters)), sep="<-")
However this pastes EACH element of the unevaluated expression. Instead
I just would like the expression to be a character string, with just ONE
element.
I tried:
toString(substitute(apply(exp.des[1:10,], 1, one.row,
parms=parameters)))
but it modifies the expression (e.g. removing parenthesis), which I do
not want.
Any idea on how to c...
2006 Oct 12
1
unevaluated expression
Hello,
x<- "something(a+b) + c"
is there any function F such that
F(x) gives me the unevaluated value of x, i.e. something(a+b)+c
I would appreciate any help on this
thanks
---------------------------------
[[alternative HTML version deleted]]
2009 Dec 01
1
Adding and Multiplying two Unevaluated Expressions
HI,
As I'm trying to compute Taylor series, I'm having problems in adding and multiplying unevaluated expressions. I searched for a solution but found none.
my Taylor function works fine for evaluating functions as you can see here:
rTaylorVal=function(exp,x0,dx,n) {
ls=list(x=x0)
newexp=eval(exp,ls)
exp0=exp
for (i in 1:n){
exp0=D(exp0,"x")
newexp=newexp+eval(exp0,ls)/factorial(i)...
2009 Dec 02
0
[Fwd: Re: Adding and Multiplying two Unevaluated Expressions]
-------- Original-Nachricht --------
Betreff: Re: [R] Adding and Multiplying two Unevaluated Expressions
Datum: Tue, 01 Dec 2009 23:49:39 +0100
Von: Benjamin M?ller <ben_mueller.bm at web.de>
An: Rolf Turner <r.turner at auckland.ac.nz>
Referenzen: <20091201144125.316310 at gmx.net>
<8E40E49F-E8FC-4FBD-8CC5-93789FFB0E53 at auckland.ac.nz>
This works fine for...
2012 Jul 24
1
Convenience function to get unevaluated ... function arguments
Folks:
Herein is a suggestion for a little R convenience function mainly to
obtain unevaluated ... function arguments. It arose from a query on
R-help on how to get these arguments. The standard (I think) idiom to
do this is via
match.call(expand.dots=FALSE)$...
However, Bill Dunlap pointed out that this repeats the argument
matching of the function call and suggested a couple of alternati...
2007 Mar 13
2
Sweave question: prevent expansion of unevaluated reused code chunk
Hi,
Consider the following (much simplified) Sweave example:
--------------
First, we set the value of $x$:
<<chunk1,eval=FALSE>>=
x <- 1
@
Then we set the value of $y$:
<<chunk2,eval=FALSE>>=
y <- 2
@
Thus, the overall algorithm has this structure:
<<combined,eval=FALSE>>=
<<chunk1>>
<<chunk2>>
@
2001 Jun 15
1
Pass-through of unevaluated arguments
...other features. In S-Plus I extended the
Trellis function xyplot mainly by writing panel.xYplot.
In R, xyplot contains a lot of code, so I implemented xYplot
by calling xyplot from it. Things are working quite well but
I would appreciate advice on programming the most elegant
solution to passing unevaluated arguments.
Here's the situation. xYplot needs to fiddle with
arguments formula and data (which I default to
sys.frame(sys.parent()) which I believe will pass through
to xyplot OK). There are several arguments passed
through to xyplot which were the "..." arguments to xYplot.
I wan...
2013 Sep 05
0
[LLVMdev] [ast-dump] Class template partial specializations missing from an implicit class template instantiation?
...cl 0x39174b0 prev 0x3917130 <col:25, col:32> struct Inner
| | |-CXXMethodDecl 0x3917540 <col:43, col:51> f 'int (void)'
| | | `-CompoundStmt 0x390f680 <col:50, col:51>
| | |-CXXConstructorDecl 0x3917610 <col:32> Inner 'void (void)' inline noexcept-unevaluated 0x3917610
| | | `-CompoundStmt 0x3918370 <col:32>
| | |-CXXConstructorDecl 0x3917770 <col:32> Inner 'void (const struct Outer<float>::Inner<int *> &)' inline noexcept-unevaluated 0x3917770
| | | `-ParmVarDecl 0x39178b0 <col:32> 'const struct...
2015 Dec 22
0
unloadNamespace() does not address unevaluated promises in the S3 Methods Table
Given the extremely simple package at
https://github.com/jimhester/testUnload, which includes only one S3 method
'print.object' the following code produces a lazy load error from a new R
session (R-devel r69801)
install.packages("testUnload", repos = NULL)
library("testUnload")
unloadNamespace("testUnload")
install.packages("testUnload", repos =
2007 Jul 18
1
Is there a facility in R similar to MatLab "syms" that allows using unevaluated numeric symbols in matrices?
Hi,
I'm trying to use R to get eigenvalues and eigenvectors of a matrix
whose elements are of the form (2 * lambda), -(lambda + mu), etc. I'd
like R to treat this matrix as a numeric matrix without treating lambda
and mu as variable names but rather as some sort of atomic quantities
(and hence give eigenvectors in terms of mu and/or lambda). MatLab and
Mathematica both do this,
2011 Apr 07
1
anyway to get R unevaluated expr independent on arguments
Hi there,
Suppose the cmd is "a<-3", I can parse the cmd sexp with R_ParseVector and eval it. My question is - is it possible to parse a cmd like "a <- ?", afterwards evaluation will give corresponding result depend on different argument? In other words, '?' is just a placeholder.
Thanks.
Xin
[[alternative HTML version deleted]]
2014 May 01
3
How to test if an object/argument is "parse tree" - without evaluating it?
This may have been asked before, but is there an elegant way to check
whether an variable/argument passed to a function is a "parse tree"
for an (unevaluated) expression or not, *without* evaluating it if
not?
Currently, I do various rather ad hoc eval()+substitute() tricks for
this that most likely only work under certain circumstances. Ideally,
I'm looking for a isParseTree() function such that I can call:
expr0 <- foo({ x <- 1 })
expr1 &l...
2009 Aug 02
1
Last expression entered by user
Hi,
I am looking for a way to find out the last expression that was
entered by the user, similar to ".Last.value", but for the unevaluated
expression instead of the evaluated one.
Example:
> x <- 4
> x*x + 3
[1] 19
> .Last.value # that's the evaluated last expression
[1] 19
# but I am looking for the unevaluated expression (".Last.expression",
so to say), which would be expression(x * x + 3) in this case...
2006 Feb 10
1
?bquote
?bquote says it returns an expression but, in fact, it typically
(though not always) returns a call object:
> class(bquote(a+b))
[1] "call"
> class(bquote(1))
[1] "numeric"
2007 Sep 19
3
delayedAssign
...give this:
> e <- (function(x, y = 1, z) environment())(1+2, "y", {cat(" HO! "); pi+2})
> (le <- as.list(e)) # evaluates the promises
$x
<promise: 0x032b31f8>
$y
<promise: 0x032b3230>
$z
<promise: 0x032b3268>
which contrary to the comment appears unevaluated. Is the comment
wrong or is it supposed to return an evaluated result but doesn't?
> R.version.string # Vista
[1] "R version 2.6.0 alpha (2007-09-06 r42791)"
2001 Feb 11
2
splitting up optional args
Hi,
A question (& possible suggestion) about function calls.
Is there an R idiom to eliminate the redundancy in the
following common situation?
foo <- function(x, control=ComplicatedDefault) { etc. }
plotfoo <- function(x, foocontrol=ComplicatedDefault, ...) {
y <- foo(x, control=foocontrol)
lines(x,y,...) }
The idea is that there are MANY
2008 Aug 07
0
sapply(Date, is.numeric) (PR#12244)
...ly(...)) C code,
> when S3 dispatch of primitive functions should happen.
The bug is in do_is, which uses CHAR(PRINTNAME(CAR(call))), and when
called from lapply that gives "FUN" not "is.numeric". The root cause is
the following comment
FUN = CADR(args); /* must be unevaluated for use in e.g. bquote */
and hence that the function in the *call* passed to do_is can be
unevaluated.
> Here's an R scriptlet exposing a 2nd example
>
> ### lapply(list, FUN)
> ### ------------------ seems to sometimes fail for
> ### .Primitive S3-generic functions
>
>...
2010 Feb 01
2
numerical subscripts in a loop in a plot
Hi R Graphics Gurus
I am unable to figure out this issues with unevaluated expressions. I'm trying to create a graphic where I calculate the residual from a regression and want to mark each residual with its observation number. So something like
plot(0,0, type = "n", xlim = c(0,10))
for(i in 1:10){
text(i, 0, substitute(paste(epsilon[i])))
}
except...