Displaying 20 results from an estimated 3000 matches similar to: "Lattice xyplot: Line and Rectangle in legend."
2009 Jan 14
1
Help with Plot/Legend
Dear R-Users
I have 2 questions:
Firstly, If I create a matplot and legend for multiple vectors and then tag
another vector on using matlines (e.g. a 'total' of all vectors), is there
anyway to add the new line to the legend without recreating it? I have
created the plot this way because I would like to define the lty and lwd for
the 'total' vector so that it can be
2009 Oct 01
2
Re gression for levels of a factor/xyplot type="r"
Hi,
I'm sure these are basic problems so I apologise in advance for my
ignorance. I have a dataset with X, Y, and a Factor with 4 levels. I am
trying to figure out how to use lm() to find the r2 value, slope and
intercept of an X~Y regression, for each level of the Factor. Is there a
way to do this automatically without having to specify different subsets of
the factor?
my code so far:
2009 Mar 22
5
If statement generates two outputs
Hi,
How do I tell an if statement to generate two seperate outputs.
E.g If X>5 I want to create df1 and df2:
if (X>5) {df1<-c(4,5,6,7,8) AND df2<-c(9,10,11,12,13)}
Thanks,
James
--
View this message in context: http://www.nabble.com/If-statement-generates-two-outputs-tp22650844p22650844.html
Sent from the R help mailing list archive at Nabble.com.
2009 Jan 07
2
Plotting a graph for every Level of a Factor
Hello,
I'm sorry if this seems similar to my last post but I thought it was
significantly different to warrent a new thread. Using the dataset below,
is there a way to generate a bar/line plot for the TACC/Catch of every lvl
of stock? i.e. OR1,OR3,OR5. The picture at the bottom of this post is an
example of the bar/line plot for OR1 which was generated when OR1 was the
only stock in the
2009 Mar 10
5
2 Simple Lattice Plot Questions
Hi,
I have created the plot below and have a few questions about changes.
1) How do I change the "Year" title of each plot so it reads from the top
"2006","2007","2008","2009".
2) How do I get rid of those vertical grey bars in the title bar of each
plot?
I apologise for my ignorance... one of those days :(
James
2009 Oct 05
2
Loop function/comparison operator problem
Hi There,
I have created the following function
format<- function(){
repeat {
form<-readline(paste("\nIn what format do you want to save these
plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp, tif, tiff, ps, eps, or
pdf.\nNote: eps is the suggested format for publication quality plots.\nPlot
format --> "));
cat("\nI'm sorry, I don't know what that format
2009 Jul 27
2
Split rownames into factors
Hi Guys,
I was wondering how you would go about solving the following problem:
I have a list where the grouping information is in the row names.
Rowname [,1]
X1Jan08 324
X1Jun08 65
X1Dec08 543
X2Jan08 23
X2Jun08 54
X2Dec08 8765
X3Jan08 213
X3Jun08 43
X3Dec08 65
How can I create the following dataframe:
Value Date Group
[1,] 324 Jan 08 X1
[2,] 65 Jun 08
2009 Jan 15
1
Zoo Plot Can't Get Rid of Box
Hi,
I apologise for the stupid question but how to you get rid of the box around
a plot in the package zoo? I can't seem to find an equivalent for bty="l"
i.e. just x and y axis.
Cheers
James
--
View this message in context: http://www.nabble.com/Zoo-Plot-Can%27t-Get-Rid-of-Box-tp21468452p21468452.html
Sent from the R help mailing list archive at Nabble.com.
2010 Mar 07
3
barplot with factors problem
http://www.harding.edu/fmccown/R/#autosdatafile
http://www.harding.edu/fmccown/R/#autosdatafile
I am tring to get a barchat by factors,
following the example in that link above.
===========================
x=c(145,40,40,120,180,
140,155,90,160,95,
195,150,205,110,160,
45,40,195,65,145,
195,230,115,235,225,
120,55,50,80,45
)
y2=c(
rep(as.character(1),5),
rep(as.character(2),5),
2009 Oct 12
1
Binding objects with a similar name
Dear R users,
The code below splits a dataset by "target_species" and then further splits
each target species group by year. Finally the sum of a variable called
"total_hook_num" is calculated and then assigned a name based on
(paste(a$target_species[1],a$year[1],sep="").
newsplit<-split(newdataset,list(newdataset$target_species))
for(i in newsplit){
2011 Jan 09
1
Rectangle height in lattice xyplot key
Dear All
I have a problem with the height of the boxes in the key in the following.
(The text is over 2 lines to accentuate the problem of no space
between the rectangles.)
Is there an easy way to put a space between the rectangles; size
controls the width but there appears to be nothing for the height?
xyplot(1~1,
key = list(corner = c(0.8,0.8),
2012 Mar 10
1
Help on subgraphs in xyplot of lattice library
Dear All,
I would like to ask a question on how to do overlay plots in each subgraph of xyplot.
1. I did simulations for m=1000, 2500, 5000, 10000, as the sample sizes.
2. for each sample size value m, 4 graphs are generated; each graph contains overlayed comparisons between 4 methods,
3. now I want put them into a 4-by-4 plot by xyplot, i.e., 4 sample size values, each of which has 4 plots.
2009 Jan 16
1
XYplot in Lattice Package
Dear R-Users
I have 2 questions to do with XYplot.
1)
I am trying to use the XYplot function to generate multiple line graphs with
the legend outside the plot.
I am using the following loop for each graph:
library(lattice)
for (i in x.sp){
xyplot(Catch~Year, df, groups = Stock, type="a",auto.key =
list(space = "top", points = FALSE, lines = TRUE,columns = 4))
}
2009 Mar 29
1
Two variables on one lattice barchart
Hi,
I created the barchart below using the lattice package, however I can't seem
to find a way to add another variable as a line (see the desired
square/lines that I drew for the last 10 years of the plot). Can anyone
help me with this? Your help is much appreciated!
Code:
Schart<-barchart(Catch~Year,data=SNA, scales=list(col = "black", tck = c(1,
0),x=list(rot=45)))
2009 Nov 06
3
Calculate Mean for each Treatment/Trial Interaction in DF
Hi,
I am create a new DF that summarizes the mean angle per treatment/trial, of
the original DF (see below). I have had some success using:
(tapply(df$Angle, INDEX=interaction(df$State,
df$Trial), FUN=mean)); however, this gives the answer as a list, which
means I would have to split the name to get the categories back. Does
anyone know a simple way to transform the Original DF into Summary
2011 Jul 27
2
Creating a flat legend 'grob' for lattice xyplot
Hi,
I want my xyplot legend to be flat, not tall, and there seems to be no way
for xyplot's auto.key and key elements to do this: I tried many, many
permutations of what I could find in the archives and reading the
documentation. If there there's a way to make it flat, please tell me what
the magic incantation is.
Here's a simple example of what I like to see. The xyplot will be a
2009 Apr 20
4
graph with 15 combinations
Dear R helpers,
I have a data set with 4 types (W, C, E & S). Now I have values for all
types plus all possible combinations (the order is unimportant): W, C,
WC, E, WE, CE, WCE, S, WS, CS, WCS, ES, WES, CES & WCES. Ideally I would
like to represent everything in one graph and as concise as possible.
Drawing 4 circles and depicting it as overlap just gives me 13 out of
the 15
2006 Dec 15
1
xyplot: legend title + legend on 1 line
Does anybody know how in xyplot to put the legend title on one line with the
legend? I can get the legend on one line with columns=... but the title is
always on top. I tried a custom key with key=... and text=... but I can't
put the title text in front of the plotting symbol.
I am looking for the following layout of the legend, on one line:
"Legend Title:" + plot symbol1 + legend
2005 Sep 16
2
help required on read.table
Hi all
i am facing a peculiar problem for data input using read.table which i
never faced previously.
i have a data file by name abnew.txt with two coloumns data as depicted below.
A B
420 422
314 321
the txt file is created using the excel save as option. i issued the
statement as
> a <- read.table("abnew.txt", header=TRUE)
> a
X.??S
1 NA
2 2
3 2
2008 Feb 08
0
[PATCH] Make outputDeviceForGeometry behave smarter when dealing with overlapping outputs. Currently, the current output is returned if some part of the rectangle is on it; otherwise the output device the rectangle center is on is returned. This works
This makes scenarios like laptops with external monitors on Xrandr 1.2 work. Those e.g. have a 1280x800 output and a 1280x1024 output, completely overlapping each other. With this patch, outputDeviceForGeometry will return the smaller head for a rectangle that's completely inside the smaller head and the larger head otherwise.
---
src/screen.c | 88