Displaying 20 results from an estimated 10000 matches similar to: "update'ing trellis object"
2007 Mar 22
2
unexpected behavior of trellis calls inside a user-defined function
I am making a battery of levelplots and wireframes for several fitted
models. I wrote a function that takes the fitted model object as the
sole argument and produces these plots. Various strange behavior
ensued, but I have identified one very concrete issue (illustrated
below): when my figure-drawing function includes the addition of
points/lines to trellis plots, some of the
2006 Nov 15
1
trellis.par.set and grid : how to set by default that I want a grid on my graphes ?
Hello all,
I want to draw a grid behind my graphes, using lattice package.
I manage to do it with instructions like this one :
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length ,
data = iris, allow.multiple = TRUE, scales = "same",type="l",
panel = function(...) { panel.grid(h=-1, v= -1) ;
panel.superpose(...)
}
)
I was wondering if there were a way to do it
2008 Apr 22
2
cloud plot has white(transparent?) background
I am using the code example from the R graph gallery to look at a
cloud plot:
require(lattice)
data(iris)
print(cloud(Sepal.Length ~ Petal.Length * Petal.Width, data = iris,
groups = Species, screen = list(z = 20, x = -70),
perspective = FALSE,
key = list(title = "Iris Data", x = .15, y=.85, corner = c(0,1),
border = TRUE,
2008 Oct 27
3
Arrays of Trellis plots
hello,
the example below does not work. (i know it's not supposed, but it makes it
clear what i'm trying to achieve)
par(mfrow=c(2,1))
xyplot(y~x2|x1,data=dataframe1,pch=20)
xyplot(y~x2|x1,data=dataframe2,pch=20)
i know i could probably merge the two datasets and do something like
xyplot(y~x2|x1+dataset,data=merged)
any other suggestion?
thanks.
[[alternative HTML version deleted]]
2004 Jan 15
5
Lattices: Cloud: Background
Hi,
There's probably some simple way of doing this, but I'm just not seeing
it - How do I get the background to be white instead of grey when I have
a cloud plot (using the lattices package)? par(bg="white") isn't
working. I'm assuming par commands won't work on lattice plots. What
should I use instead?
Thanks,
Adrienne
[[alternative HTML version deleted]]
2008 May 06
1
Spacing between lattice panels
I'm trying to set up a lattice plot with two y-axes for each panel. (Yes,
I know that multiple y-axes are generally a bad idea; the graph is for
someone else and they want it that way.) I've used a custom
yscale.component in xyplot to achieve this:
myyscale.component <- function(...)
{
ans <- yscale.components.default(...)
ans$right <- ans$left
foo <-
2012 Jul 30
1
lattice legen and auto.key conflict
Hello R-helpers,
I'm trying to customize a graphic in lattice using the 'legend' argument to add labels on my plot but in the process I'm losing the legend drawn by 'auto.key', despite the fact that I'm actually not sticking these on the same sides of the graphic. I worked up a quick and simple example with the iris data :
### here's the basic graph
2006 May 31
2
a problem 'cor' function
Hi list,
One of my co-workers found this problem with 'cor' in his code and I confirm it too (see below). He's using R 2.2.1 under Win 2K and I'm using R 2.3.0 under Win XP.
===========================================
> R.Version()
$platform
[1] "i386-pc-mingw32"
$arch
[1] "i386"
$os
[1] "mingw32"
$system
[1] "i386, mingw32"
$status
2008 Oct 13
2
split data, but ensure each level of the factor is represented
Hello,
I'll use part of the iris dataset for an example of what I want to
do.
> data(iris)
> iris<-iris[1:10,1:4]
> iris
Sepal.Length Sepal.Width Petal.Length Petal.Width
1 5.1 3.5 1.4 0.2
2 4.9 3.0 1.4 0.2
3 4.7 3.2 1.3 0.2
4 4.6 3.1 1.5
2008 Feb 27
2
multiple plots per page using hist and pdf
Hello,
I am puzzled by the behavior of hist() when generating multiple plots
per page on the pdf device. In the following example two pdf files
are generated. The first results in 4 plots on one pdf page as
expected. However, the second, which swaps one of the plot() calls
for hist(), results in a 4 page pdf with one plot per page.
How might I get the histogram with 3 other scatter
2011 Jul 28
2
not working yet: Re: lattice overlay
Hi Dieter and R community:
I tried both of these three versions with ylim as suggested, none work: I
am getting only single (pch = 16) not overlayed (pch =3) everytime.
*vs 1*
require(lattice)
xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris,
panel= function(x, y, subscripts) {
panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10))
panel.lmline(x, y, lty=4, col =
2010 Jun 09
4
question about "mean"
Hi there:
I have a question about generating mean value of a data.frame. Take
iris data for example, if I have a data.frame looking like the following:
---------------------
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4
0.2 setosa
2 4.9 3.0 1.4
0.2
2012 Jul 10
3
fill 0-row data.frame with 1 line of NAs
Dear all
Is there a simpler method to achieve the following: When I obtain an
empty data.frame after subsetting, I need for it to contain one line
of NAs. Here's a dummy example:
> (.xb <- iris[ iris$Species=='zz', ])
[1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species
<0 rows> (or 0-length row.names)
> dim(.xb)
[1] 0 5
> (.xa <-
2005 Sep 16
6
How do I get the row indices?
Hi,
I was wondering if it's possible to get the row
numbers from a filtering. Here's an example:
# give me the rows with sepal.length == 6.2
iris[(iris[,1]==6.2),]
# output
Sepal.Length Sepal.Width Petal.Length Petal.Width
Species
69 6.2 2.2 4.5 1.5
versicolor
98 6.2 2.9 4.3 1.3
versicolor
127 6.2
2009 Oct 17
1
Easy way to `iris[,-"Petal.Length"]' subsetting?
Dear all
What is the easy way to drop a variable by using its name (and not its
number)? Example:
> data(iris)
> head(iris)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1
2006 Dec 18
5
Replacing values
Hi all,
I have to recode some values in a dataset. for example changing all zeros to
"." or 999 would be also ok. does anybody know how to do this? thanks in
advance. lars
--
View this message in context: http://www.nabble.com/-R--Replacing-values-tf2841687.html#a7934402
Sent from the R help mailing list archive at Nabble.com.
2006 Dec 14
5
Nicely formatted tables
If I use latex(summary(X)) where X is a data frame with four
variables I get something like
Rainfall Education Popden Nonwhite
Min. :10.00 Min. : 9.00 Min. :1441 Min. : 0.80
1st Qu.:32.75 1st Qu.:10.40 1st Qu.:3104 1st Qu.: 4.95
Median :38.00 Median :11.05 Median :3567 Median :10.40
Mean :37.37 Mean :10.97 Mean :3866
2012 Jul 23
1
duplicated() variation that goes both ways to capture all duplicates
Dear all
The trouble with the current duplicated() function in is that it can
report duplicates while searching fromFirst _or_ fromLast, but not
both ways. Often users will want to identify and extract all the
copies of the item that has duplicates, not only the duplicates
themselves.
To take the example from the man page:
> data(iris)
> iris[duplicated(iris), ] ##duplicates while
2008 Aug 07
6
multiple tapply
Hi folk,
I tried this and it works just perfectly
tapply(iris[,1],iris[5],mean)
but, how to obtain a single table from multiple variables?
In tapply x is an atomic object so this code doesn't work
tapply(iris[,1:4],iris[5],mean)
Thanx and great summer holidays
Gianandrea
--
View this message in context: http://www.nabble.com/multiple-tapply-tp18868063p18868063.html
Sent from the R help
2011 Aug 16
3
Newbie question - struggling with boxplots
Hopefully I will not be flamed for this on the list, but I am starting out
with R and having some trouble with combining plots.
I am playing with the famous iris dataset (checking out example dataset in R
while reading through Introduction to datamining)
What I would like to do is create three graphs (combined boxplots) besides
each other for each of the three species (Setosa, Versicolour and