Displaying 20 results from an estimated 70 matches for "plot2".
Did you mean:
plot
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 advance,
Jonathan Thompson
2010 Aug 20
3
if-else function
...fferent 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 4
ParasiteE...
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 effects:
Fo...
2010 Jun 30
5
plot focus
...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(2,1))
screen(1) # prepare screen 1 for out...
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 Abundance2... AbundanceN
.
.
.
PlotN AbundanceN Ab...
2004 Feb 20
1
unexpected postscript output with par(mfg)
...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 = "", ylab = "")
plot(1:10, 1:10, xlab = "", ylab = "")
dev.copy2eps(file = "plot2.eps")
If I use postcript() directly instead of dev.copy2eps(), plot1 is
again fine, and plot2 appears fine when viewed in gv. However, when
plot2 is included into a LaTeX file (via \includegraphics), it is
upside-down and backwards and resized.
Has anyone encountered such behavior before...
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
2012 Dec 13
3
Repeat elements of matrix based on vector counts
...ny 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))
*************************************************************************...
2011 Nov 08
1
Building package problem
...s ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking examples ... ERROR
Running examples in 'hydroGOF-Ex.R' failed
The error most likely occurred in:
> ### Name: plot2
> ### Title: Plotting 2 Time Series
> ### Aliases: plot2
> ### Keywords: dplot
>
> ### ** Examples
>
> sim <- 2:11
> obs <- 1:10
> ## Not run:
> ##D plot2(sim, obs)
> ## End(Not run)
>
> ##################
> # Loading daily streamflows of the Ega Rive...
2012 May 10
6
averaging two tables (rows with columns)
...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 that table 2 does not have sp...
2012 Jun 27
3
qplot and colors (Please Help)
Please help:
I am using qplot as below and want to specify a different color scheme for race but dont know how, can someone show me.
Thanks in advance
Code and input file below:
library(ggplot2)
library(gridExtra)
d<-read.table("results", header=TRUE, fill=TRUE)
plot2<-qplot(X,Y,data=d,color=race,facets=TYPE~., xlab="X", ylab="Y") + theme_bw()
grid.arrange(plot2,ncol=1)
dev.off()
cat? results
<snip>
X?????? Y?????? ID????? race??? TYPE
0.0350?...
2009 Apr 14
2
subset dataframe by rows using character vector?
...t.
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 <- cbind(v1, PLOT...
2007 Nov 23
1
R 2.6 and library(survival)
...ckage and I am trying to analyze some
data and present plots. The problem occurs when I try to plot lines on
the same plot. E.g. take simulated data for time (t), event (e) and groups
(group1 and group2) and do:
### this is how I create the plots
plot1<-survfit(Surv(t,e)~ as.factor(group1))
plot2<-survfit(Surv(t,e)~ as.factor(group2))
plot(plot1)
lines(plot2,type="s")
Error in rep(2, n2 - 1) : invalid 'times' argument
The plot is created (plot1) but the lines (plot2) are not. I have run this same program
several times from my previous pc (R 2.4 was installed)and I...
2006 Mar 19
2
tick mark intervals
...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.)
range of y-axis = (0,100)
Now I can obtain the values at which there should be tick marks for each of
the above plots. The problem is that
when I plot them with...
2004 Sep 09
2
Skipping panels in Lattice
...b !="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 cell
is shunted to the top left of row 1 and the last panel of plot1 is now
moved to page 2. Messing with layout= doesn't help, neither does
substituting NA...
2002 Nov 12
2
Wandering usr values in par(no.readonly=TRUW) (PR#2283)
...ic y-axes that failed after
repeated calls if I tried to restore the graphical parameters (which I wanted to
do because I used `layout' within the routine. I tried to isolate the problem
and found out that the following code with logarithmic axis is sufficient for
reproducing the failure:
> plot2.log
function (x=1:2,y=1:2)
{
op <- par(no.readonly=TRUE)
on.exit(par(op))
cat(op$usr, "\n")
plot(x, y, log="y")
#par(op)
invisible(op)
}
Here is a session with the typical error message (Infinite axis extents):
> op <- par(no.readonly=TRUE)
> op$...
2008 Jan 12
2
Lattice equivalent of par(mfrow = )
Dear r-helpers,
Does anyone have a straightforward example of putting together three
unrelated (expect for a common y-axis) xyplot() figures in what would
be in base graphics a par(mfrow = c(1, 3)) arrangement?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102
2011 Mar 08
4
beamer overlays with Sweave?
...but I'm wondering if anyone has a
solution (even a hack) for creating multiple (overlay) plots in an
Sweave file and post-processing the overlays in beamer appropriately.
For example, suppose I have a series of figure blocks in my .Rnw file:
<<plot1,fig=TRUE>>=
[stuff]
@
<<plot2,fig=TRUE>>=
[stuff]
@
<<plot3,fig=TRUE>>=
[stuff]
@
These three blocks create three figures that I want to have appear as
a series of overlays in the final PDF file.
Sweave outputs the following LaTeX code:
\includegraphics{plot1}
\includegraphics{plot2}
\includegraphics{pl...
2012 Jul 02
1
Dependency problem for "hasArg"
Dear list,
I'm running an R script which first line is:
#!/usr/bin/Rscript
While running that script from the system console (in Red Hat
Enterprise Linux 6) I got the following error:
Error in plot2(x = sim, y = obs, plot.type = "single", main =
paste("Daily", :
could not find function "hasArg"
Calls: plot_results -> plot_out -> ggof -> plot2
However, if I call EXACTLY the same script from the R console, by using
> source("myRscript.R&quo...
2000 Jun 22
1
R 1.1 congrat; undocumented behaviour of recordPlot
...t<-recordPlot()
> t.plot
works perfectly.
Now, if I add further elements to this (regenerated) plot, they get drawn
all right (I tested only abline()), which surprised me . But when I re-save
the result, only the new additions get saved:
> abline(h=9) # works (to my surprise)
> t.plot2<-recordPlot # saves only the addition, as can be seen by:
> str(t.plot2)
OK, so I thought I might regenerate the combined plot by
> t.plot # worked
> t.plot2 # cleared graph, but did nothing
I think it would be useful to be able to save and replay additions to a plot
as well as com...