Displaying 20 results from an estimated 94 matches for "plot1".
Did you mean:
plot
2007 Dec 26
1
seekViewport error
Why does the seekViewport at the bottom give an error?
> xyplot(Sepal.Length ~ Sepal.Width, iris, group = Species, col = 11:13,
+ auto.key = TRUE)
> grid.ls(view = TRUE)
ROOT
GRID.rect.89
plot1.toplevel.vp
plot1.xlab.vp
plot1.xlab
1
plot1.ylab.vp
plot1.ylab
1
plot1.strip.1.1.off.vp
GRID.segments.90
1
plot1.strip.left.1.1.off.vp
GRID.segments.91
GRID.text.92
1
plot1.panel.1.1.off.vp
GRID.segments.93
GRID....
2008 Nov 11
1
Retrieving x argument name from a trellis object in R 2.8.0
Dear all,
let consider the following function:
Fun1 <- function() {
library(lattice)
plot1 <- 1:10~1:10
pl1 <- xyplot(plot1)
return(pl1$call$x)
}
In R 2.5.0 (or older version) we have
> Fun1()
plot1
but starting from R 2.5.1 until the latest R 2.8.0 we obtain instead
> Fun1()
NULL
because pl1$call seems to be equal to xyplot() without arguments.
Something like xy...
2007 May 31
4
Aggregate to find majority level of a factor
I want to use the aggregate function to summarize data by a factor (my
field plots), but I want the summary to be the majority level of another
factor.
For example, given the dataframe:
Plot1 big
Plot1 big
Plot1 small
Plot2 big
Plot2 small
Plot2 small
Plot3 small
Plot3 small
Plot3 small
My desired result would be:
Plot1 big
Plot2 small
Plot3 small
I can't seem to find a scalar function that will give me the majority
level.
Thanks in adva...
2005 Dec 26
4
lme X lmer results
Hi,
this is not a new doubt, but is a doubt that I cant find a good response.
Look this output:
> m.lme <- lme(Yvar~Xvar,random=~1|Plot1/Plot2/Plot3)
> anova(m.lme)
numDF denDF F-value p-value
(Intercept) 1 860 210.2457 <.0001
Xvar 1 2 1.2352 0.3821
> summary(m.lme)
Linear mixed-effects model fit by REML
Data: NULL
AIC BIC logLik
5416.59 5445.256 -2702.295
Random effect...
2003 Oct 19
2
problem with win.metafile( ): traceback()
For the first error message:
> win.metafile(file = "//.../plot1.wmf",
+ width = 8.5, height = 6.25)
> lset( list( background = list(col = "white")))
Error in get(x, envir, mode, inherits) :
variable "win.metafile://.../plot1.wmf" was not found
> traceback()
4: get(device)
3: trellis.device(device = .Device, new = FALSE)
2: trel...
2011 Jul 19
5
multiple plots in single frame: 2 upper, 1 lower
Hi,
par(mfrow = c(2,2))
will create a 2x2 window that I can use to plot 4 diferent figures in:
[plot1 plot2]
[plot3 plot4]
But how can do 3 so that the bottom spans the width of the upper two:
[plot1 plot1]
[p l o t 3]
Is this possible in R?
--
View this message in context: http://r.789695.n4.nabble.com/multiple-plots-in-single-frame-2-upper-1-lower-tp3679574p3679574.html
Sent from the R he...
2010 Aug 20
3
if-else function
...o characterize different plots containing counts of
variables (here parasites). If a plot has a count equal or higher than
4 for any parasite the function should return a 1 else a 0. Later I
can loop the function over all plots.
Here I have a little subset of my data:
VariablePAR Plot1 Plot2
Plot3 Plot4
ParasiteA 3 1 1 4
ParasiteB 1 2 3 5
ParasiteC 2 1 1 3
ParasiteD 2 1 1...
2004 Sep 09
2
Skipping panels in Lattice
..."C1","C2")), dv=rpois(15*3*4*2,10))
# now get rid of the cell B4 & C1 to simulate a missing treatment combination
df2 <- df1[df1$facb !="B4" | df1$facc !="C1", ]
# plain vanilla lattice plot generates an empty panel corresponding to the
empty cell
plot1 <- bwplot( dv ~ faca | facb*facc, data=df2)
plot1
# now try to skip the empty panel
# turn plot history on so that the separate pages can be recalled
plot2 <- update(plot1, skip=c(rep(F, 3), T, rep(F, 4)))
plot2
and the 4th panel position of the bottom row is skipped, BUT the B4&C1 cel...
2008 Jan 25
4
Function for translation of a list into a matrix as used by ordination?
Hello.
Does anyone know of an existing function that takes a list in the form of:
Plot1 Species1 Abundance1
Plot1 Species2 Abundance2
Plot2 Species1 Abundance1
Plot2 Species3 Abundance3
.
.
.
PlotN SpeciesN AbundanceN
and translates into a matrix in the form of
Species1 Species2.... SpeciesN
Plot1 Abundance1 Abundance2... AbundanceN
Plot2 Abundance1...
2008 Sep 19
1
Lines between panels in lattice
Hello,
I have a multi-page display each consisting of two-panels above each
other.
I need to draw a line from the top panel to bottom panel. Using
current.vpTree()
i find that "plot1.panel.1.2.vp" and "plot1.panel.1.1.vp" are the top
and bottom ones respectively.
I am using the following code(inspired by Paul Murrell's R Graphics)
to draw a line.
(All the co-ordinates lie well within the ranges of the respective
panels)
seekViewport("plot1.panel.1...
2007 Dec 11
2
ggplot - Setting the y-scale in a bar plot
...ould like to have a set of plots all with the
same y-axis height. But I do not seem to find out how to fix the
scale of the y-axis in this case.
Any tips?
Using R 2.6.1 on Windows.
Thanks for any help,
Pedro
I attach below the code I am using:
plotdata<-data.frame(x=factor(2:8), y=0.1*(2:8))
plot1<-ggplot()
plot1<-plot1+layer(data=plotdata,
mapping=aes_string(x='x',y='y'),geom='bar', stat='identity')
RangeY <-c(0,1)
YBreaks <- (0:10)*diff(RangeY)/10
YTickLabels<- as.character(YBreaks)
plot2 <- plot1 + scale_y_continuous(limits=RangeY, brea...
2012 Dec 13
3
Repeat elements of matrix based on vector counts
...df based on
how many times "plot.id" is repeated in the 1st df (all plots are repeated
a different number of times). My example dfs are below:
************************************************************************************************
df1 <- data.frame(plot.id = rep(c("plot1", "plot2", "plot3"),
c(3,2,5)),
tree.tag = c(111,112,113,222,223,333,334,335,336,337))
df2 <- data.frame(plot.id = c("plot1", "plot2", "plot3"), load=c(17,
6, 24))
******************************************************...
2008 Nov 24
3
multiple plots in R
Hi, I just try to draw multiple plots in one page using R, I used par
command. For example I have 7 plots, but instead of arranging them in
the default way
plot1 plot2 plot3
plot4 plot5 plot6
plot7
I want them in this order
plot1 plot2 plot3
plot4 plot5 plot6
plot7
Could somebody tell me how to do this, please? Thanks so many.
Suyan
2004 Feb 20
1
unexpected postscript output with par(mfg)
...ode produces a working plot (no problems, as far as I
can see):
par(mfrow = c(2,2))
plot.new()
plot(1:10, 1:10, xlab = "", ylab = "")
plot(1:10, 1:10, xlab = "", ylab = "")
plot(1:10, 1:10, xlab = "", ylab = "")
dev.copy2eps(file = "plot1.eps")
However, the following code, which appears on the screen to be
identical to the above plot, generates an EPS file which ghostview/gv
displays as blank.
par(mfrow = c(2,2), mfg = c(1,2))
plot(1:10, 1:10, xlab = "", ylab = "")
plot(1:10, 1:10, xlab = "", y...
2006 Mar 19
2
tick mark intervals
...is is the same for
all of them but the y-axis is different.
What I would like to do is to have a different range of the y-axis and
different intervals between tick marks. BUT
I would like to have the same number of tick marks and I would like the
y-axis to look the same.
EXAMPLE (with two plots):
plot1: number of tick marks = 11
interval between tick marks = 5 (i.e. tick marks at
0,5,10,15, etc.)
range of y-axis = (0, 50)
plot2: number of tick marks = 11
interval between tick marks = 10 (i.e. tick marks at
0,10,20,etc.)...
2012 May 10
6
averaging two tables (rows with columns)
...rateful- I am spending so much time to figure it out. It should not be so hard, I think.
I have very big data but I have created a hypothetical data for simplification.
for example
I have : table 1
table 1: species occurance data
speciesX
speciesY
speciesZ
speciesXX
Plot1
1
0
1
0
Plot2
0
1
1
0
Plot3
0
0
0
1
Plot4
1
0
1
0
Table 2
table 2. species tolerance data
EnviA
EnviB
EnviC
speciesX
0.21
0.4
0.17
speciesY
0.1
0.15
0.18
speciesXX
0.14
0.16
0.19
You may noticed tha...
2010 Jun 30
5
plot focus
...the results by adding a
point to each of 2 charts at the end of the loop. Its very informative as
you can see the progression through time.
My problem is, if I have 2 plots, I don't know how to get the focus back to
the first plot.
layout(matrix(c(1,2)))
plot(iris[,1],col="red",) #plot1
plot(iris[,3],col="blue") #plot2
#goes on plot2
lines(iris[,2],col="pink")
#how do I put this line on plot 1
lines(iris[,4],col="black")
I tried the method below but when you switch the focus back to screen 1 the
line gets drawn not where I expect
split.screen(c...
2008 Sep 19
0
Fwd: Lines between panels in lattice
...))
> xyplot(x[,2]~x[,1]|x[,3],layout=c(1,2))
> x
>
> #x[,3]==2 is in the top panel and x[,3]==1 is in the bottom panel
> #so x[6:,] onwards is on the top panel and x[1:5,] is in the bottom
> #to find out the names of the viewports, use current.vpTree()
>
> seekViewport("plot1.panel.1.2.off.vp")
> grid.move.to(unit(x[10,1],"native"),unit(x[10,2],"native"))
> seekViewport("plot1.panel.1.1.off.vp")
> grid
> .line
> .to
> (unit
> (x[1,1],"native"),unit(x[1,2],"native"),gp=gpar(col='#aaaaaa',...
2009 Apr 08
1
Tinn-R pdf()
Dear R and Tinn-R users,
i recently switched to Tinn-R and sending code to R works fine (R 2.8.1,
Tinn-R 2.2.0.2, OS Windows XP). However, i encountered a problem when
trying to send plots to pdf files like this:
library(lattice)
pdf("plot1.pdf")
PLOT<-(xyplot, ...)
PLOT
dev.off()
The file "plot1.pdf" is created, but it is empty.
If i paste the code above directly into the R console and run it, the file
"plot1.pdf" is created and in this case contains "PLOT".
I guess that some settings in Tinn-...
2009 Apr 14
2
subset dataframe by rows using character vector?
...lling to help me out.
I queried a dataframe which returns a character vector called "plot". I have another dataframe from which I want to subset or select only those rows that match "plot". I've tried subset, and also the "which" command.
plot <- c("plot1", "plot2", "plot3") # character vector used to select rows from data
# create fake data from to try out subset
v1 <- c(2,5,6,4,3)
PLOTID <- c("plot1", "plot2", "plot3", "plot4", "plot5")
full.data &...