Displaying 20 results from an estimated 20468 matches for "expressions".
Did you mean:
expression
2005 Jun 06
2
Bug in new() or validObject() in methods package (PR#7922)
Something in new() or validObject() in the methods package is messing
up. This happens in both 2.1.0 and R-devel in Windows.
I'd like to have an empty expression for a slot in a class. An empty
expression is an expression:
> is.expression(expression())
[1] TRUE
>
> is(expression(), "expression")
[1] TRUE
> class(expression())
[1] "expression"
2012 Mar 15
3
single, double or no quotes in expression
Dear all,
I am confused about how to create an expression. I use a package (rsbml)
which uses expressions and seems to make a difference if there is a quote
around the expression or not.
For example, package works with expressions such as
> expression(A + B)
but not with
> expression("A + B")
I now have a set of math expressions represented as strings, something like
this:
> rhs_e...
2010 Nov 26
3
Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)
# The result I am after is the result after a substitution in an expression, such as
substitute(expression(a+b+c), list(a=1))
expression(1 + b + c)
# However, the way I want to do it is for a an expression "stored as a variable" as
(expr <- expression(a+b+c))
expression(a + b + c)
# a) The following does not work
(expr2 <- substitute(expr, list(a=1)))
expr
# b) - whereas this
2004 Jul 27
2
Incorrect display of b[hat((a))] expression in plots
Hi, I am not sure if this is a bug or a non-implement feature of
text-drawing functions with TeX-style expression, but hat() and some of its
equals does not get the right "bounding boxes" if they are put in sub- or
superscripts. For instance, for the expression 'b[hat(a)]' the hat() seems
to shift 'hat(a)' too much to the right of 'b'. Try the below example and
2007 Mar 27
7
Replacement in an expression - can't use parse()
...do the replacement?
I have tried using:
> e = parse(text=gsub("u2","x",e))
> e = parse(text=gsub("u3",1,e))
Even though this works fine in this simple example, the use of parse
when e is very long will fail since parse has a maximum line length
and will cut my expressions. I need to keep mode(e)=expression since I
will use e further in symbolic derivation and division.
Any suggestions are most welcome.
Thank you.
Regards,
Daniel Berg
2007 Feb 04
4
Reading expressions from character vectors
...is very straightforward, but I just
can't wrap my head around it. I've read the help pages on text,
plotmath, expression, substitute, but somehow I can't find the answer
to this simple question.
Basically consider the following example:
plot( NULL, xlim = c(0,2), ylim = c(0,2) )
expressions <- expression( -infinity, infinity )
text( c(0.5,1.5), 1.5, expressions )
labels <- c( "-infinity", "infinity" )
text( c(0.5,1.5), 0.5, as.expression(labels) )
I want the character vector "labels" to be interpreted as an
expression vector, and so to appear j...
2010 Jan 29
2
evaluating expressions with sub expressions
Hallo
I'm having trouble figuring out how to evaluate an expression when one of
the variables in the expression is defined separately as a sub expression.
Here's a simplified example
mat <- expression(0, f1*s1*g1) # vector of formulae
g1 <- expression(1/Tm) # expansion of the definition of g1
vals <- data.frame(f1=1, s1=.5, Tm=2) # one set of possible values for
2013 Aug 23
3
[LLVMdev] defining symbols with lld
...he expression, that can be used to emit YAML information
Or a parse tree of the expression.
> e)The expression tree needs to be stored into the Native intermediate representation too right ? Store them as atoms ? How to represent constants and functions ?
Well, technically the only places these expressions come from is the command line or linker scripts, so we don’t *have* to have a way to externalize the atoms in yaml or native format. But, it would be nice to allow that, so that some future C or asm extension would let you create these.
> f) What about lld core ?
> g) Create a new reference...
2009 Jul 23
3
How to pass a character argument which contains expressions to arg.names in barplot?
...hole expression as
> tit5
[1]
"c(expression(n[paste[5,1]),expression(n[paste[5,2]),expression(n[paste[5,3]),expression(n[paste[5,4]))"
but it doesn't work neither
I wonder if there is some way that barplot "tells" arg.names to "evaluate"
the contents of tit4 as expressions, not as characters
I hope I made myself clear enough
Thanks in advance to any response
Cheers!!!!
Javi
--
View this message in context: http://www.nabble.com/How-to-pass-a-character-argument-which-contains-expressions-to-arg.names-in-barplot--tp24630656p24630656.html
Sent from the R help maili...
2001 Apr 30
2
plotting an expression
I am sure it is just me not understanding how R works, but could somebody
explain why
curve(cos(x))
works and
curve(expression(cos(x))
does not?
I have done some investigating and here is what I found. If I comment out
the line of curve indicated below, both calls work fine.
function (expr, from, to, n = 101, add = FALSE, type = "l", ylab = NULL,
log = NULL, xlim =
2006 Nov 21
2
Symbolic derivation using D in package stats - how do I properly convert the returned call into a character string?
...rform symbolic
derivation.
This works very well and it is much faster than e.g. Mathematica (at
least for my purposes).
First, I would like to thank the development team for this excellent
function.
However, I run into trouble in some cases, particularly when I am to do
some operations on long expressions obtained from using D.
The problem seems to occur when I convert a 'call' or an 'expression' to
a 'character', then some parts of the original 'expression' is lost.
Is there some way of transforming a call or an expression into a
character string that I do not know...
1997 Nov 03
1
R-alpha: expression(..) objects -- c(ex1, ex2) `fails'
When investigating the
legend(x,y, expression ( <math>, <math> ), ....)
[as suggested by Jim Lindsey],
I once again stumbled over the fact that expression objects behave somewhat
``wierdly'', IMHO.
We can have expressions of length(.) > 1, and access elements of these like
list elements.
However, other natural things don't work with expressions; some example code:
##-- `Simple' length--1 expressions:
ex1 <- expression(hat(beta) == (X^t * X)^{-1} * X^t * y)
ex2 <- expression(bar(x) == sum(over(x[...
2004 Sep 06
4
substitution in expression
I have been struggling with this problem for a while and I hope someone
could help me. Or if someone could point me to a section in the manual I
would be grateful.
x <- "my"
plot(1:10, main=expression(paste( x, Delta, "values" )))
Q : How do I get the title to say "my (triangle symbol) values" ?
The following trial-and-error produced mainly errors :
2013 Aug 22
3
[LLVMdev] defining symbols with lld
On Aug 22, 2013, at 1:32 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
> On Thu, Aug 22, 2013 at 12:54 PM, Shankar Easwaran <shankare at codeaurora.org> wrote:
> Hi Nick,
>
> I am planning to work on adding support for definining expressions for the Gnu flavor.
>
> Currently Gnu ld supports an option --defsym symbol=expression. The expression may be composed of other symbols.
> Any symbol that appears in the expression, gets its value from the output symbol value (address of the symbol in the output file).
>
> In addit...
2013 Nov 04
2
[LLVMdev] compile error when using overloaded = operator of DenseMap
Hi,
I am trying to implement Available Expressions data flow analysis. I
created the following class (I am giving here code snippet.):
namespace {
typedef DenseMap<Expression, uint32_t> DMTy; //Expression is a class I
defined.
struct DataFlowValue {
DMTy ExprMap;
llvm::BitVector* DFV;
// Functions operating on the data //...
2006 Mar 06
3
how to make plotmath expression work together with paste
Recent questions about using plotmath have renewed my interest in this question
I want to have expressions take values of variables from the
environment. I am able to use expressions, and I am able to use paste
to put text and values of variables into
plots. But the two things just won't work together.
Here is some example code that shows what I mean.
plot(NA,xlim=c(0,100),ylim=c(0,100))
#show...
2024 Apr 27
1
Should c(..., recursive = TRUE) and unlist(x, recursive = TRUE) recurse into expression vectors?
Reading the body of function 'AnswerType' in bind.c, called from 'do_c'
and 'do_unlist', I notice that EXPRSXP and VECSXP are handled identically
in the recurse = TRUE case.
A corollary is that c(recursive = TRUE) and unlist(recursive = TRUE)
treat expression vectors like expression(a, b) as lists of symbols and
calls. And since they treat symbols and calls as
2013 Oct 10
2
Help with expression()
Hi everyone,
I am hoping someone can help with my attempted use of the expression
function. I have a long series of text and variable to paste together
including a degree symbol. The text is to be placed on my scatter plot
using the mtext function.
Using expression like this:
changetext = expression(paste("Change from ",mini," to ", maxi, ":",
diff
2006 Sep 27
2
How to pass expression as an argument
Hi,
I am writing a function and need to pass a function expression as an argument, for instance,
myfun <- function( express) {
x<- c(1,2,3)
y<-express
}
if I call the above function by myfun( x*2 ), I get 2 as the result, instead of 2,4,6 , could someone help me to
fix this problem ?
Furthermore, is that
2001 Jul 03
2
How do one modify an expression?
I am using expressions to annotate x and y labels in plots. I start of with
a label as
xlab <- expression(X)
Note that it is the user that sets this. It could also be something more
complicated as expression(sqrt(R*G)). Can I easily add a log[2] "around"
this expression? I would like to get
xlab <-...