Displaying 20 results from an estimated 10000 matches similar to: "unexpected behaviour of expression(sum())"
2007 Jul 16
2
substitute and expression
Hi,
I'm trying to understand whether the use of substitute() is
appropriate/documented for plotmath annotation. The following two
calls give the same results:
> plot(1:10, main = expression(alpha == 1))
> do.call(plot, list(1:10, main = expression(alpha == 1)))
But not these two:
> plot(1:10, main = substitute(alpha == a, list(a = 2)))
> do.call(plot, list(1:10, main =
2005 Jan 11
2
Changes in expression in R 2.0.1
Hello!
plot(1:10,main=expression(1 <= "m" <= 5))
The above command works perfectly in R 1.9.1 but returns an error in R 2.0.1
This is documented in NEWS for R 2.0.0 (or ONEWS in R 2.0.1) and it is said:
o R no longer accepts associative use of relational operators.
That is, 3 < 2 < 1 (which used to evalute as TRUE!) now causes
a syntax error. If this
2007 May 04
2
Qt device update
Hi,
a few days back I had asked for help on a Qt device package. Thanks to
hints from Duncan TL and Thomas Friedrichsmeier, I now have something
more or less functional. For those interested, It can be downloaded
from
http://dsarkar.fhcrc.org/R/R-Qt.html
I have a couple of related questions. First, dev.interactive(), used
in example() and many demo()-s to decide if the current device is
2007 Jul 19
1
substitute and expression (Peter Dalgaard)
In this connection, note the following
> a4 <- 4
> plotThis <- bquote(alpha==.(a), list(a=a4))
> do.call(plot, list(1:10, main=do.call(expression, c(plotThis))))
> do.call(plot, list(1:10, main=do.call(expression, plotThis)))
Error in do.call(expression, plotThis) : second argument must be a list
> ## Whereas plotThis has class "call", c(plotThis) has class
2006 Sep 11
2
unexpected behaviour when defining a function
Hi,
I know S manuals used to warn against using the same names for a
variable and a function, but I have never seen that cause problems in
R, so I usually don't pay much attention to it. Which is why the
following behaviour came as a surprise:
> bar <- function() 1
> foo <- function(bar = bar()) {
+ bar
+ }
> foo(9)
[1] 9
> foo()
Error in foo() : recursive default
2004 Nov 18
1
Declaration of RuleThickness() in src/main/plotmath.c (PR#7380)
Full_Name: Wolfgang Huber
Version: R-2.0.1
OS: HP-UX B.11.23 ia64
Submission from: (NULL) (81.104.215.6)
Hi,
I hope I am not missing something basic... I am using a somewhat exotic compiler
and OS, but if I understand what I am seeing the problem is more general:
In src/main/plotmath.c, the following function is defined
/* Thickness of rules */
static double RuleThickness()
{
return
2000 Sep 12
1
Variable value in expression (plotmath)
Hello,
I have a problem with the plotmath facility and haven't found any solution
in the FAQ and Online-Help.
I am trying to incorporate the value of a variable in an expression for an
axis with plotmath.
Considering having
> gamma <- 10
I'd like to have a plot with
> plot( .... , xlab=expression(gamma==10))
but depending on the true value of the variable.
How can I
2010 Aug 24
2
percentage sign in expression
Readers,
According to the documentation for the function 'plotmath' there is no
apparent possibility to add the percent sign (%) to a plot function,
e.g.
plot(a[,1]~b[,2],ylab=expression(x~%),xlab=expression(z))
How to achieve this please?
yours,
rhelp at conference.jabber.org
r251
mandriva2009
2007 Nov 15
2
Using plotmath expressions in lattice key text
Folks:
delta <- 1:5
I would like to put 5 separate lines of text of the form "10 %+-% delta[i]"
into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol
and delta[i] is the ith value of delta.
The construct:
lapply(delta,function(d)bquote(10%+-%.(d)))
appears to produce a list of expressions of the correct form, and, indeed,
if I assign the above
2010 Oct 04
2
plotmath: how to use greek symbols in expression(integral(f(tau)*dtau, 0, t))?
I would like to use greek "tau" as a symbol of variable to integrate
over in plotmath
expression(integral(f(tau)*dtau, 0,t))
but nothing seems to work. I tried d{\tau}, d\tau, etc.,
without any success
Is it possible? How can I accomplish this?
Best regards,
Ryszard
--------------------------------------------------------------------------
Confidentiality Notice: This message is
2006 Oct 24
2
Plotmath expression
Hello,
I've been trying to plot a subscript in a text formula using plotmath but I
haven't been able to do so.
In my example below I would like the text label to show
X[min] = 10.1 +/- 5.5
Here is the code:
ll <- c(x=10.1, sde=5.5)
plot(1:10)
text(x=9, y=2, pos=2, expression(paste(X[min], "=", paste(ll,
collapse="+/-"))))
This works fine up to the inner paste
2010 Aug 27
3
How to plot an expression-label with variable text
Disclaimer: I have read plotmath, but maybe it's too late today:
How do I get the two labels to be the same:
plot.new()
lab =expression(paste("Estimated ", t[50]," from tgv"))
text(0.5,0.5,lab)
# Should look the same as above. I could not get the substitute right:
what = "tgv"
lab =expression(paste("Estimated ", t[50]," from ",what))
2005 Mar 26
1
Trouble with expression() in R-win 2.0.1
Hi.
The following statement works fine in R-win 1.8.0, but yields a syntax
error in R-win 2.0.1 (and possibly in other versions after 1.8.0):
plot(c(1,2),main=expression(a==b==c))
I note that the following workaround executes successfully in both
versions of R...
plot(c(1,2),main=expression(a*"="*b*"="*c))
...but I don't really understand
2004 Dec 15
1
RE: Lattice update error (PR#7423)
OK. Sorry to have bothered you. It may well have been the namespace issue, a
subtlety that I would have been unaware of. Thanks. I've cc'ed this to
r-bugs in case there is anything they wish to do about it.
-- Bert Gunter
> -----Original Message-----
> From: Deepayan Sarkar [mailto:deepayan@stat.wisc.edu]
> Sent: Wednesday, December 15, 2004 12:05 PM
> To: Berton Gunter
2008 Apr 02
1
Trouble combining plotmath, bquote, expressions
I'm using R-2.6.2 on Fedora Linux 9.
I've been experimenting with plotmath.
I wish it were easier to combine expressions in plotmath with values
from the R program itself. There are two parameters in the following
example, the mean "mymean" and standard deviation "mystd". I am able
to use bquote to write elements into the graph title like
mu = mymean
and R will
2007 Jan 10
2
prime in expression in plot
I want to write something like (LaTeX style)
b_{norm}=\frac{F\prime(0)}{R\prime(0)}
how do I add the "prime" (first derivative) to a R-plot? The help of
"plotmath" just talks about "partialdiff". Can you complete this
command?
text( 30,0.05,labels=expression(b[plain("norm")]==frac(F(0),R(0))) )
Thanks,
Thomas
2017 Jul 30
2
greek letters do not work in expression
> On Jul 30, 2017, at 8:25 AM, Uwe Ligges <ligges at statistik.tu-dortmund.de> wrote:
>
>
>
> On 30.07.2017 17:22, Milan Cisty wrote:
>> Dear all,
>> I appreciate suggestions for following problem. I wrote to RStudio:
>> plot(c(1,20),c(1,20), xlab = expression(paste(alfa)))
>> or the same happen when I wrote:
>> plot(c(1,20),c(1,20), xlab =
2013 Dec 02
2
plus/minus +/- in factor; not plotmath not expression
I want to put the "plus or minus" symbol into a character variable, so that this can be turned into a factor and be displayed in the "strip" of a faceted ggplot2 plot.
A very nice solution, thanks to Professor Ripley's post of Nov 16, 2008; 3:13pm, visible at http://r.789695.n4.nabble.com/Symbols-to-use-in-text-td874239.html and subsequently
2003 May 25
0
surprising behaviour of "bgroup": sets all in greek letters (PR#3099)
Let me summarize the bug reported by Ulf Martin on R-help with the same
subject line.
The code
plot(1:10)
text(1, 9, expression(F == bgroup("{", x, "")))
results in greek letters, which is not expected here.
That happens if the user tries to set only a left delimeter, the same with:
text(2, 8, expression(F == bgroup("{", x, ".")))
or
2005 Aug 14
1
complex expression with plotmath
Hello everyone,
I want to define a function that receives the name of two variables
(may include Greek letters and subscripts) and uses them into the
title of a plot.
My best attempt is the following:
myplot <- function(var1, var2) {
v=paste(var1,"==1 & ",var2,"==2");
plot(1:10, main=parse(,,v))
}
But when I call it with something like myplot("Q[i]",