Displaying 20 results from an estimated 7000 matches similar to: "adding error bars to lattice plots"
2006 Jun 06
2
error bars in lattice xyplot *with groups*
Hi all,
I'm trying to plot error bars in a lattice plot generated with xyplot. Deepayan
Sarkar has provided a very useful solution for simple circumstances
(https://stat.ethz.ch/pipermail/r-help/2005-October/081571.html), yet I am
having trouble getting it to work when the "groups" setting is enabled in
xyplot (i.e. multiple lines). To illustrate this, consider the singer data
2010 Feb 20
3
Error Bars in lattice- barcharts
Hello,
I am attempting to write a script that adds error bars to a barchart. I
basing my attempt heavily on the following thread:
http://tolstoy.newcastle.edu.au/R/e2/help/06/10/2791.html
I can't seem to get around the problem that was discussed in the thread. The
following example should illustrate my problem. Sorry about the messy
example but I am 1) trying to make it as close as possible
2007 Oct 17
1
passing arguments to functions within functions
Dear R Users,
I am trying to write a wrapper around summarize and xYplot from Hmisc
and am having trouble understanding how to pass arguments from the
function I am writing to the nested functions.
There must be a way, but I have not been able to figure it out.
An example is below.
Any advice would be greatly appreciated.
Thanks, Dan
# some example data
df=expand.grid(rep=1:4,
2011 Aug 04
0
error bar plot with log scale in lattice
Hi, all,
I'm trying to modify the code to a log scale for y-axis from the post
http://tolstoy.newcastle.edu.au/R/help/06/06/28612.html
However, the error bar did not change accordingly. The following is the code I used based on the singer.ucl data.
Thanks in advance!
prepanel.ci <- function(x, y, ly, uy, subscripts, ...)
{
y <- as.numeric(y)
ly <-
2009 May 27
1
Changing point color/character in qqmath
Having solved this problem, I am posting this so that the next time I search
for how to do this I will find an answer...
Using qqmath(..., groups=num) creates a separate qq distribution for each
group (within a panel). Using the 'col' or 'pch' argument does not
(usually) work because panel.qqmath sorts the data (but not 'col' or 'pch')
before plotting. Sorting
2013 Feb 15
3
lattice 3x3 plot: force common y-limits accross rows and align x-axes
Good afternoon,
I would like to ask for help in controlling y-axis limits and labels in
lattice doplots. Unfortunately, the problem is somewhat convoluted,
please bear with the long explanation.
I would like to create a 3x3 lattice of dotplots, say subject ~ count.
The plot is conditioned on variables treatment and risk: subject ~ count
| treatment + risk. In the experiment, not all subjects
2003 Dec 25
3
Problem plotting with xyplot
Hi all,
I am just learning R and I am trying to work through the book "Applied
Longitudinal Data Analysis" by Singer & Willett. I have some code for this book
that supposedly works in S-Plus (I don't have S-Plus so I can't verify that) and
I am trying to run the examples in R. Most of the examples run, but I have
one plot that gives me an error message. I have
2005 Jan 17
2
bwplot: how not to draw outliers
RenE J.V. Bertin wrote:
> Hello, and (somewhat belated) best wishes for 2005.
>
> Can one order not to draw outliers in bwplot, or at least exclude them from the vertical axis scaling? If so, how (or what doc do I need to consult)?
> The options that have this effect in boxplot() do not appear to have any effect with bwplot (although outline=FALSE in boxplot does *not* change the
2010 May 25
2
segplot (latticeExtra)
Hi,
I'm having a bit of trouble with 'scales="free"' in the segplot()
function of latticeExtra. Say we need panels for each year, showing
only those counties that are represented in each one:
---<--------------------cut here---------------start------------------->---
library(latticeExtra)
data(USCancerRates)
uscr.w <- subset(USCancerRates, state ==
2010 Nov 10
0
error bars in lattice barchart
Hi all,
I've read the emails of Dan, Deepayan and Sundar about adding error bars to
the lattice plots (
https://stat.ethz.ch/pipermail/r-help/2006-October/114883.html), but I still
have the problem when I want to adding error bars to barchart. I tried both
the solution of Deepayan and Sundar but without luck. Here is my code (I
changed prepanel.ci and panel.ci a little to plot bars
2006 Mar 01
2
lattice-Internal
Hi,
The functions prepanel.default.bwplot() and lpretty() are not running in Deepayan's
barley example concerning vertical bars with the lattice function barchart().
Why, is there a restricted use for the package lattice-Internal?
Urs Simmen
mailto:usimmen at dtc.ch
2004 Aug 15
3
Stacking Vectors/Dataframes
Hello,
Is there a simple way of stacking/merging two dataframes in R? I want to
stack them piece-wise, not simply add one whole dataframe to the bottom of
the other. I want to create as follows:
x.frame:
aX1 bX1 cX1 ... zX1
aX2 bX2 cX2 ... zX2
... ... ... ... ...
aX99 bX99 cX99 ... zX99
y.frame:
aY1 bY1 cY1 ... zY1
aY2 bY2 cY2 ... zY2
... ... ... ... ...
aY99 bY99 cY99 ...
2013 Mar 15
5
Data manipulation
Hello all,
I would appreciate your thoughts on a seemingly simple problem. I have a
database, where each row represent a single record. I want to aggregate this
database so I use the aggregate command :
D<-read.csv("C:\\Users\\test.csv")
attach(D)
by1<-factor(Class)
by2<-factor(X)
W<-aggregate(x=Count,by=list(by1,by2),FUN="sum")
The results I
2008 Aug 07
2
panel.arrows problem in custom panel function
Dear List,
I am writing a custom panel function and xyplot method to plot the
results of a procrustes analysis from the vegan package.
I am having trouble getting the call to panel.arrows to work as I wish
when conditioning. The attached file contains the function definitions
for the xyplot method and the custom panel and prepanel functions I am
using. This example, using data and functions from
2011 Aug 02
1
lattice: index plot
Dear all,
How can I make an index plot with lattice, that is plotting a vector
simply against its particular index in the vector, i.e. something
similar to
y <- rnorm(10)
plot(y)
I don't want to specify the x's manually, as this could become
cumbersome when having multiple panels.
I tried something like
library(lattice)
mp <- function(x, y, ...) {
x <- 1:length(y)
2010 Jan 14
1
lattice dotplot with missing levels in factor variable
Hi,
I am trying to create a dotplot where each panel shows levels vs.
responses; the levels are sorted by responses but levels vary from one
panel to another. However, I run into problems with controlling the
y-limits and y-labels.
In particular, suppose I have a data frame
rsp <- c(10,2,4,0,2,3)
lvl <-
2008 Jun 26
3
Connecting lines across missing data points, xyplot
All,
I have data across 5 time points that I am graphing via xyplot, along with
error bars. For one of the variables I have missing data for two of the
time points. The code below is okay but I can't seem to get the lines to
connect across the missing time points. Does anyone now how to rectify
this?
Cheers,
David Afshartous
library(lattice)
## the data
junk = data.frame(
Visit =
2012 May 17
3
New Eyes Needed to See Syntax Error
One of many scripts to produce 4 lattice plots on one page keeps throwing
an error. I've tried manipulating the file to eliminate the error, but have
not been able to do so. The error is:
> source('bicarb.R')
Error in source("bicarb.R") : bicarb.R:15:1: unexpected symbol
14: 15: hco33
^
The 'h' is in column 0 so the caret would be column -1, but it's
2005 Feb 16
1
panel/prepanel for polar plots ala xYplot
First a bit of background:
After doing a search for a flexible polar plot function and coming up
empty, I have begun writing one myself. Since I am new to writing
mid-level graphics routines, this has required some learning about
lattice, grid and related things.
I am to the point where I have a workable proof of concept, but still
need to make some improvements. My goal is to have
2005 Aug 24
1
histogram method for S4 class.
Hi,
I'm trying to develop an histogram method for a class called "FLQuant"
which is used by the package FLCore (http://flr-project.org). FLQuant is
an extension to "array". There is an as.data.frame method that coerces
flquant into a data.frame suitable for lattice plotting. The problem is
that when I coerce the object and plot it after it works but if the
method is