Displaying 20 results from an estimated 10000 matches similar to: "Mathematical expressions in the group labels in lattice"
2006 Jun 07
1
Fw: Help needed using lattice for area plots lpolygon, xyplot.
I am trying to learn how to use the graphics from the lattice package (
and am very new to R).
I am trying to replicate the example plot referenced below, by using the
lattice xyplot & lpolygon to create panels. I get what appears to be the
correct shape of the filled region, but cannot get the position to overlay
properly. I have attempted with various settings of position. ( i.e.
2009 Mar 13
1
malformed plot symbols in lattice pdf
Hi,
I'm using panel.polygon inside a custom panel function to generate
filled polygons for an xyplot. Everything is as expected until I
specify a value < 1 for alpha to fill with a semi-transparent color
and output to pdf. The plot symbols appear malformed. Am I doing
something wrong here?
Thanks,
Mark
Here is an example (pdfs are attached):
library(lattice)
## example data
2009 Jul 08
1
A Lattice Question
To the Lattice expert -
I am new to the lattice package and I would like to add a curve to the
xyplot(). I know that I need to use panel function to add it. But it doesn't work. Is there anyone can help me out on how to transfer the data into the function?
The following is my code and I would like to add lines for xx,yy
xx <- seq(0,1,length = 100);
yy <-
2010 May 18
1
Maximization of quadratic forms
Dear R Help,
I am trying to fit a nonlinear model for a mean function $\mu(Data_i,
\beta)$ for a fixed covariance matrix where $\beta$ and $\mu$ are low-
dimensional. More specifically, for fixed variance-covariance matrices
$\Sigma_{z=0}$ and $\Sigma_{z=1}$ (according to a binary covariate $Z
$), I am trying to minimize:
$\sum_{i=1^n} (Y_i-\mu_(Data_i,\beta))' \Sigma_{z=z_i}^{-1} (Y_i-
2004 Jul 29
2
expression + paste + arguments + ...
dear R wizards: I would like to write a function that roughly places
the equivalent of the following latex text into the current plot:
\newcommand{ \placesigma }[4]{ \put(\#1,\#2){ \sigma_{A , #3} = #4 }
I cannot figure out how to do this. I know I have to use a function
that uses expressions in a text() invoke. But passing arguments and
nesting strings and expressions has so far not
2007 Jan 29
1
overlay xyplot on contourplot in lattice in R
Hi everybody,
I want to do a contourplot in lattice with my raw data overlaid on it(xyplot)
which seemed to be a very easy thing to do.
I've tried it in many ways, but I haven't succeeded at obtaining it.
let's say x, y, and z as the variables that comes from the data frame ''ex'':
therefore my countourplot is as followed :
contourplot(z ~ x * y, cuts=550)
I
2007 Jan 02
1
lattice panel.linejoin type question
Hello R Users!
I'm trying to use the panel.linejoin function to draw points and lines
(type="o") but it wouldn't do it. Modifying the panel.linejoin function
as such (adding type argument to the panel.lines call).
*original*
panel.lines(vals[xx], yy, col = col.line, lty = lty,
lwd = lwd, ...)
*modified
panel.lines(vals[xx], yy, col = col.line, lty
2008 Aug 29
3
extract variance components
HI,
I would like to extract the variance components estimation in lme function
like
a.fit<-lme(distance~age, data=aaa, random=~day/subject)
There should be three variances \sigma_day, \sigma_{day %in% subject } and
\sigma_e.
I can extract the \sigma_e using something like a.fit$var. However, I cannot
manage to extract the first two variance components. I can only see the
results in
2009 Jun 19
1
using garchFit() to fit ARMA+GARCH model with exogeneous variables
Hello -
Here's what I'm trying to do. I want to fit a time series y with
ARMA(1,1) + GARCH(1,1), there are also an exogeneous variable x which I
wish to include, so the whole equation looks like:
y_t - \phi y_{t-1} = \sigma_t \epsilon_t + \theta \sigma_{t-1}
\epsilon_{t-1} + c x_t where \epsilon_t are i.i.d. random
variables
\sigma_t^2 = omega + \alpha \sigma_{t-1}^2 + \beta
2004 Oct 06
0
quadratically constrained quadratic programming
Hi,
Does anybody have experience to solve an quadratic programming problem
with quadratic constraints in R?
It seems that the package "quadprog" only handles the quadratic
programming with linear constraint. My probelm is to maximze
x^T\Sigma_{xy} y,
subject to x^Tx=1, y^T\Sigma_{yy} y=1, and sum(y)<t, or sum(y)=t, where
x and y are the variable, and the Sigma's and t are
2007 Apr 22
1
labels
Hello, I would like to add to axis labels special caracters. Instead of writing :plot(simul, xlab="beta", ylab="sigma11") It would be great if I could write something as in LaTeX :plot(simul, xlab="\beta", ylab="\sigma_{11}") Is there a way to do that ? Thank you
_________________________________________________________________
ues clics pour retrouver tout
2006 Oct 02
2
xyplot Graphic Help
I have the following graphic where I drop unused factors in the x axis, however I cannot get the first point on the second panel. It seems shifted. Any ideas?
The example is below:
data <- data.frame(
Room=as.factor(c(132,132,132,132,132,132,132,132,132,196,196)),
2005 Nov 12
1
Updating in attempt to rotate ylab
What am I doing wrong? (please cc me when replying)
yy <- 1:10
xx <- yy*2
xYplot(yy~xx,ylab="") #this plots as it should
text(.4,5,expression(paste(log, frac(p(b),p(a)) )))
Error in text.default(0.4, 13, expression(paste(log, frac(p(b), p
(a))))) :
plot.new has not been called yet
This is the case even when I write:
xxyy <- xYplot(yy~xx,ylab="")
xxyy <-
2003 Oct 20
1
controling x-labels in xyplot (lattice) when x is POSIX object
Hi,
V1.8.0 seems to allow DateTimeClasses as the x argument in xyplots (lattice).
For example:
x <- seq.POSIXt(strptime("2003/01/01", format = "%Y/%m/%d"),
strptime("2003/10/01", format = "%Y/%m/%d"), by = "month")
y <- rnorm(length(x))
dat <- data.frame(x= x, y = y)
xyplot(y ~ x, data = dat, type = "b")
2011 Aug 15
2
Alternative and more efficient data manipulation
Hello list,
## I have been doing the following process to convert data from one
form to another for a while but it occurs to me that there is probably
an easier way to do this. I am often given data that have column names
which are actually data and I much prefer dealing with data that are
sorted by factors. So to convert the columns I have previously made
use of make.groups() in the lattice
2010 Jan 15
1
What is the newline escape sequence when using the Hershey fontfamily?
Hello!
The question is simple: What is the escape sequence for a new line when
using Hershey fonts? I obviously tried '\n' but it didn't work (see the
sample below). I looked at 'demo(Hershey)' but all it only shows escape
sequences for printable characters.
The sample I've been using to try to find the escape sequence is below.
You can comment or un-comment the
2009 Jul 09
2
Lattice xyplot: same scales within one factor
I am using R 2.8.1 and lattice to produce xyplots conditioned on
two factors. What I would like is to have the scales be free between values
of one factor, but some within. Thus, in the example:
xyplot(mpg ~ disp | factor(gear) + factor(cyl), mtcars,
scales=list(x=list(relation="free")))
rather than having the x scales be free within a gear as well, I want it to
be the same for
2007 Mar 07
5
How to open more windows to make more graphs at once!
Dear R users,
I have a data frame (test) including five columns of upper (numeric), lower (numeric), observed (numeric), best_sim (numeric) and stname (factor with 80 levels, each level with different length). Now I would like to write a short program to draw one graph as follow for each level of stname but I would like also to draw each time 12 graphs for the 12 levels of stname in the same
2006 Jul 19
2
trellis.focus with postscript device
Hello.
First: R 2.3.1 on Windows XP.
I am trying to add information (sample size) to the Trellis strips which
I am successful using the trellis.focus function with the default
Windows device. However, I typically use the postscript device as I use
LaTeX and \includegraphic for incorporating graphs into stat reviews.
Here's some example code (apologies for the lack of creativity and
2009 Sep 19
3
reducing space between charts in lattice graphics
Hi,
I'm trying to create a lattice plot with three xyplots in one vertical
column. I would like to reduce the vertical space between the charts. My
code is below. There seems to be a "between" parameter for lattice.options,
but I can't find any examples. Aside from the data setup, the code is below.
Can anyone provide an example showing how to reduce the white space between
the