Displaying 20 results from an estimated 8000 matches similar to: "Variable value in expression (plotmath)"
2000 Sep 20
1
SV: sample from contingency table
I have had the same problem and I wrote this function
rmulti <- function(n, size, p)
{
NrDim <- length(p)
if(NrDim<2) stop("The simulated variabel has to be at least
2-dimensional")
res <- matrix(data=NA, nrow=n, ncol=NrDim)
p <- p/sum(p)
TempSize <- size
for(i in 1:NrDim)
{
TempP <- p[i]/sum(p[i:NrDim])
TempBin <- rbinom(n=n, size=TempSize,
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))
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
2011 Dec 06
1
Graphics device hook to manipulate plotmath
Is there a hook that allows a graphics device to apply transformations
to plotmath expressions *before* they are rendered? If there isn't
one yet, would it be feasible to add one?
The motivation for this hook is graphic devices that feed into
something that already has support for math layout, such as the
tikzDevice package (which has TeX downstream). Given
text(x, y,
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
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]",
2008 Sep 03
1
plotmath help with expression
reg.line <- function(y, x, title)
{plot(y~x, main=title, xlab="TSS", ylab="Aluminum")
line <- lm(y~x)
d <- summary(line)
legend("topleft", legend=paste(expression(r^2), "=" ,d$r.squared,
sep=" "), bty="n")
abline(line)}
reg.line(1:10, 10:1, "line")
how do I get the legend to print the plotmath symbol expression(r^2)
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
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
2006 Dec 14
1
legend/plotmath/substitute problem
Dear R Experts,
I am trying to produce a legend for a series of plots which are
generated in a loop. The legend is supposed to look like this:
2000: gamma=1.8
where gamma is replaced by the greek letter and both the year and the
value of gamma are stored in variables.
Everything works fine as long as I have only one data series:
year = 2001
g = 1.9
plot(1)
legend('top',
2002 Feb 14
1
apropos("plotmath") curiousity
?plotmath produces the helpscreen for plotmath.
Why does apropos("plotmath") return only character(0)?
> apropos("plotmath")
character(0)
>
> version
_
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
status
major 1
minor 4.1
year 2002
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
2012 May 12
2
Plotmath bug or my misunderstanding?
This is a followup to a recent post on using atop() to obtain
multiline expressions.
My reading of the plotmath docs makes it clear that issuing (in base
graphics) the specification
par(cex = 2)
doubles symbols and regular text in subsequent plotmath expressions.
However, it is unclear to me what specifying cex _within_ the
annotation function using plotmath should do, and the following seems
2003 Aug 07
2
plotmath under windows (PR#3672)
Full_Name: Murray H Smith
Version: 1.7.1
OS: Windows2000
Submission from: (NULL) (202.36.29.1)
This alleged bug is Windows specific and occurs when using Windows metafile
plots.
The problem does not occur in a Linux version.
It does not occur in the pt rintout when a graphic is saved to a postscript file
under Windows.
The problem came to light when using plotmath to label a plot with
2012 Mar 16
2
variable values in plotmath expressions
## I would like help in using variable values in plotmath expressions
## in lattice
x <- 1:10
y <- 1:10
pval <- .95
plot(y ~ x, ## works as I want in base graphics
main=substitute(list(alpha * " = " * group("",list(p),"")),
list(p=pval)))
plot(y ~ x, ## doesn't work as intended: "pval" is displayed
main=substitute(list(alpha *
2011 Mar 01
2
expression help
Hello,
I am trying to write math-type on a plot. Due to space limitations on
the plot, I want 2 short expressions written on top of each other. It
is certainly possible to write them in two separate calls, but that
involves fine-tuning locations and a lot of trial and error (and I'm
trying to write a general purpose function).
Here's where I've gotten to:
2011 Jan 20
4
puzzled with plotmath II
sorry, I forgot my sessionInfo: please see below.
-------- Original Message --------
Subject: puzzled with plotmath
Date: Thu, 20 Jan 2011 12:48:18 +0100
From: Claudia Beleites <cbeleites at units.it>
To: R Help <r-help at r-project.org>
Dear all,
I'm puzzled with matrix indices in plotmath.
I'm plotting matrix elements: Z [i, i], and I'd like to put that as label.
2004 Oct 14
0
plotmath in underlined style; was: Re: [R] Underline in expression(). (PR#7286)
In order not to forget it (I have not got any answer so far) ...
Uwe Ligges
-------- Original Message --------
Subject: plotmath in underlined style; was: Re: [R] Underline in
expression().
Date: Sun, 26 Sep 2004 18:50:02 +0200
From: Uwe Ligges <ligges@statistik.uni-dortmund.de>
Organization: Fachbereich Statistik, Universitaet Dortmund
To: John Janmaat <jajanmaat@netscape.net>,
2004 Apr 14
1
ltext, plotmath, and substitute
I am interested to use plotmath functions within a panel function but am having
some problems getting the code right. Within each panel I am plotting the data,
fitting a regression line, and would like to print the regression equation.
Here is a trivial example of what I'd like to do:
# generate simple data
tmp.df <- data.frame(id = rep(1:4, each=4),
time = rep(1:4, 4),
das =