Displaying 20 results from an estimated 4000 matches similar to: "lattice barchart using a time scale in x axis"
2010 Apr 03
2
histogram-like barplot? (or reverse?)
Hi,
I have a simple task I can't figure out. I'd like to take
some measurements I made, e.g.:
year (y-axis)
1
2
3
4
5
6
counts (x-axis)
10
10
20
30
40
50
And then, make a barplot with the x-axis ticks (representing
the borders between years) between the bars.
However, barplot seems to force you to make the x-axis
arbitrary categories. I want it to be continuous (as in a
2010 Apr 19
2
Overlay of barchart and xyplot
Hello R Folks,
I am new to R. I have been struggling to overlay a barchart with a
xyplot together on one plot but did not get this worked out. Any help
and idea are greatly appreciated.
I attached R scripts for barchart and xyplot below and also data I used.
What I am trying to do is just to put the barchart and xyplot together
on one plot.
Huapeng
<<dispersal_infestation.csv>>
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)))
2012 May 01
1
error bars for a barchart
Hi
I have the following barchart to which I want to add error bars.
library(lattice)
barchart(Change~fTreat,groups=Process,change,
auto.key=list(points=FALSE,rectangles=TRUE),
panel=function(x, y,...){
panel.barchart(x,y,origin = 0,...);
panel.abline(h=0,col="black",...);
}
)
I have tried
2010 Nov 30
2
Error bars in lattice barchart with groups
Dear R-users,
i want to plot gene regulation data in a lattice barchart. To illustrate
the problem i encounter, the following code uses the "barley"dataset:
library(lattice)
barley[["SD"]] <- 5
PLOT <- barchart(data=barley, yield~variety|site, groups=year,origin=0,
as.table=TRUE,
scales=list(x=list(relation="same",
rot=30),
y=list(alternating=3,tck=-1)),
2003 May 08
2
border of bars in lattice barchart
Hello!
How to change a color (or linewidth) of
border in lattice 'barchart'?
I am trying
barchart(
(......) - my arguments
panel=function(x,y,color,subscripts,groups,...)
{
panel.barchart(x=x,y=y,box.ratio=2,col=color,border=FALSE)
}))
or
...
panel.barchart(x=x,y=y,box.ratio=2,col=color,border='transparent')
...
or
2009 Feb 08
2
Using panel.grid in barchart
Hi all,
I'm trying to do an example in Deepayan Sarkar's Lattice book. It
involves making a barchart based on the Titanic dataset. I can get
the barchart to plot fine; however, when I try to edit panel.grid, I
get an error:
> titan<-barchart(Class ~ Freq | Age + Sex, data =
as.data.frame(Titanic), groups=Survived, stack=TRUE, layout=c(4,1),
2003 Nov 02
3
barchart in lattice
Dear all,
I have two factors 'country' and 'status' which I would like to plot via barchart (lattice).
'status' consist of three different levels and should be the grouping variable, i.e. there
should be drawn three different panels and within each panel a barchart of 'country'.
barchart(daten$COUNTRY|daten$STATUS),
2008 Sep 16
2
Setting user colors in barchart
Dear R Users,
I have a basis question regarding the use of color in the lattice package. I
read the ?barchart help page and searched the R archives but could not
understand how to do it.
I just need to plot a barchart using specific colors for my groups, e.g.
green and red instead of the default lattice colors. How do I do that?
If I say:
barchart(x ~ a_factor, groups=my_groups,
2006 Oct 28
1
What determines the order of rows in a lattice barchart?
Hi,
What determines the order of the rows in a barchart?
Cheers,
Geoff.
Here is my code, and the data follows. If I have z in alpha order, the
barchart is in
some order I can't determine. I originally tried
rownames(twater)~twater$Cat, but the
chart wasn't in rownames(twater) order either.
library(lattice)
twater<-read.csv("totalwater.csv",strip.white=T)
2009 Oct 12
1
Loading data to Trellis barchart plot.
Dear all,
I have a question about loading the data to barchart plot. I know this could
be a very easy question, but I just can not get my head around.
What I need to do is to create a trellis plots barchart style (horizontal
bar), with levels of one variable (ie. variable “colour” in my example) as
ylab and frequency as xlab on each trellis plot. The trellis plots is
separated based on
2007 Jul 10
1
Lattice: vertical barchart
barchart(Titanic, stack=F) produces a very nice horizontal barchart.
Each panel has four groups of two bars.
barchart(Titanic, stack=F, horizontal=F) doesn't produce the results I
would have expected, as it produces this warning message:
Warning message:
y should be numeric in: bwplot.formula(x = as.formula(form), data =
list(Class = c(1,
And it results in each panel having 22 groups of
2006 Jan 25
2
panel function with barchart (lattice)
Folks at R help,
I can't quite get the panel function to work the way I
want within barchart.
I guess I'm still not understanding how to piece
together multiple panel
arguments, especially when "groups" is specified.
Example: I want to be able to add the value of "yield"
to each section of
each bar in this graph:
barchart(yield ~ variety | site, data = barley,
2004 Feb 10
3
confidence-intervals in barchart
Hi R users,
1) How does one show confidence-intervals in a barchart and use rownames for
labels on the y-axes? I have looked at "plotCI" in "gregmisc" package . But
it does not seem to produce something like a barchart. The statistic, error,
upper-bound, and lower-bound are in a dataframe.
2) How to show CI in a barchart either using the statistic and, either (a)
2007 Jun 22
1
Barchart legend position
I am using barchart to make charts for some data with a lot more
functions and labels and such in the command.
barchart(Freq ~ factor(HH), data = dataset1, group= year)
So I have my data grouped by year and I get a legend at the top of
graph, which is great cause I need the legend for the different years
but it is a weird spot. So how can I manipulate the legend, ie. Move
it, shrink it, do
2007 Feb 24
2
barchart (lattice) with text labels
I would like to place the value for each bar in barchart (lattice) at
the top of each bar. Something like the following code produces.
library(lattice)
mypanelfunc <- function(x, y, ...)
{
panel.barchart(x, y, ...)
panel.text(x, y, labels=as.character(round(x,2)), ...)
}
myprepanelfunc <- function(x, y, ...) list(xlim=c(0, max(x)+.1))
mydata <- expand.grid(a=factor(1:5),
2010 Apr 03
2
Export bug? Hist() vs. barchart().
Hi,
If you want to export a single bar chart, this works:
> png( "ET" );
> barchart( data[,"ET"] )
> dev.off()
quartz_off_screen
2
But if you want to export a few of them, this does not:
> factorCols <- c("MR","ET");
> sapply( factorCols, function(x) {
+ png( x );
+ barchart( data[, x] );
+ dev.off();
+ } );
2008 Jun 26
1
Gettting barchart titles as numbers not characters
Hi, I wonder if you could help me with my barcharts, I am using the
barchart function from the lattice library.
I have data like this:
Complex,Organisms,Percentage
130,0,50
130,1,10
130,2,20
130,3,15
130,4,5
133,0,10
133,1,15
133,2,20
133,3,50
133,4,5
I draw barcharts using this command...
2005 Jun 25
1
Confidence interval bars on Lattice barchart with groups
I am trying to add confidence (error) bars to lattice barcharts (and
dotplots, and xyplots). I found this helpful message from Deepayan
Sarkar and based teh code below on it:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/50299.html
However, I can't get it to work with groups, as illustrated. I am sure I
am missing something elementary, but I am unsure what.
Using R 2.1.1 on various
2010 Jan 20
3
barchart with stacked and beside bars
Hi,
Is there a way to stack bars in a barchart as well as "beside" bars for the
same treatment? eg....
I have one barchart like this:
bio<-matrix(c(10,23,9,25),nrow=2,byrow=T)
ntreat<-c("n0","n96")
colnames(bio)<-ntreat
barplot(bio,beside=T)
now i want a similar barchart but with stacked bars: