Displaying 20 results from an estimated 5000 matches similar to: "Group labels in lattice barchart"
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,
2005 Nov 15
1
combination xyplot and barchart?
Dear R community,
I am having trouble determining how to create the graph I want
utilizing my relatively limited knowledge of R. So far I have been
using the lattice library to create most of what I need.
The dataset (enviro) consists of 2 variables (Temp and Precip) for each
Day of a 2-yr period (Year). I wish to display Temp and Precip along
the y axis plotted by Day on the x axis to allow
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
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)),
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:
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
2006 Dec 08
1
missing factor levels in a lattice barchart panel cause unexpected failure
Hi all - I'm trying to generate lattice barchart graphs with missing
values, and came across the following:
This does not run. I would expect it to:
library(lattice)
D = data.frame(X=1, Y=factor(letters[2], letters[1:2]))
barchart(~ X, D, groups=Y)
Error in grid.Call.graphics("L_rect", x$x, x$y, x$width, x$height,
resolveHJust(x$just, :
invalid line type
which is simply
2012 Mar 03
2
Grouped barchart confidence intervals in lattice
Hi everyone,
I'm having trouble adding error bars to a grouped barchart in lattice. I know that this topic has been addressed quite a bit, as I've been searching the internet for a while to try to troubleshoot the issue, but I've not been able to find any solution that I could get working on my data. I was wondering if someone could look at my code and tell me what I'm doing
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),
2006 Apr 14
1
Adding values to top of bars in barchart
Given the following data frame ("freq.sp"),
> str(freq.sp)
`data.frame': 42 obs. of 4 variables:
$ behav : Factor w/ 6 levels "approach","bowride",..: 1 1 1 1 1 1 1 2
2 2 ...
$ species: Factor w/ 7 levels "COAST_SPOT","EAST_SPINR",..: 1 2 3 4 5 6
7 1 2 3 ...
$ n : int 193 194 563 357 570 369 74 194 208 633 ...
$ pct :
2011 Aug 04
1
labelling a stacked barchart (lattice)
All:
Below is my code for creating a basic horizontal, stacked barchart. I'd like to label the plot in two ways: 1) place the x values in each piece and 2) place the y values above each piece (angled). I'm currently using lattice, but I'm open to suggestions using ggplot2.
Questions:
1. Can this be done?...I assume yes. So, what are the best options/functions for doing this.
2.
2004 Oct 19
1
barchart fails when grouping variable has more than 7 levels (PR#7293)
Full_Name: Andreas Kiermeier
Version: 2.0.0
OS: Windows XP
Submission from: (NULL) (203.26.122.12)
I've struck a problem drawing barcharts after installing R 2.0.0. Previously
I've used the following command
print(barchart(100*result ~ sample,
groups=congener,
data=dioxin.2003.fresh.ub.p, stack=TRUE, ylim=c(0,102)))
to draw a stacked barchart of the
2010 Feb 20
1
How get the single bar x coordinate in barchart when groups is used?
Hi all,
I am using barchart() to plot values above the bars. When using groups argument we get bars grouped arround a given x level. By placing values above this bars we need to know the respective x coordinates. How can I get it?
require(lattice)
da <- expand.grid(x=1:5, z=1:3, w=1:2)
da$y <- rpois(da$x, lambda=23)
barchart(y~x|w, groups=z, data=da, horizontal=FALSE,
2009 Mar 30
1
advice for alternative to barchart
hi folks,
I was wondering if anybody could give me some advice. I've created a
stacked barchart, with 'car model' along the x axis, 'number of cars' along
the y axis. There are 45 individuals involved, each of which can own any
number of cars, of any model (eg an individual could own two cars of one
model, and another car of a different model). I've got a legend by the
2012 Jan 20
1
Stacked barchart in ggplot (or other library)
Hey,
I want to create a stacked barchart in R for the following dataset
(http://pastebin.com/pyHUNgr2):
# usage capacity diff
1 4 10 6
2 2 20 18
3 5 10 5
The stacked barchart should, in one plot show each line of the dataset as a
stacked bar using data from 'usage' and 'diff' to create the stacked bar.
I can't find a good example of how to do this on the ggplot2 site.
2011 Jan 26
1
barchart panel.text add label value and percent
Hello everybody,
i need some help to display text as label in my barchart
the label is the combination of x value + text
text= calculated percentage => per
it display properly the x value
but, wrongly repeats the text of the fisrt level LangueTXT factor on the
second
any solution?
Thanx very much
Christophe
######## here is the code ##########
library(lattice)
Langue <- c(1, 1, 1, 2, 2,
2018 Sep 22
2
grafico de barras (barchart) con barras de error y achurado (hatching) en lugar de escala de grises
Que tal comunidad, hace dias que estoy en un problema que no puedo
resolver. Resulta que debo confeccionar un grafico de barras (columnas)
que debe incluir barras de error. La unica forma en que me resulto es
con barchart() de la libreria Hmisc, y haciendo un truco un poco
complicado para mi nivel de usuario autodidacta. Ahora que ya lo tengo
(despues de semanas de busqueda) resulta que me
2018 Sep 22
2
grafico de barras (barchart) con barras de error y achurado (hatching) en lugar de escala de grises
Gracias Carlos !!! ... alguna idea con la libreria lattice ? es solo
que tengo que hacer 3 graficos diferentes y el aspecto de los mismos
quedara diferente con lattice y ggplot. Voy a ver si me resulta todo en
ggplot.
Saludos y gracias de nuevo,
Eric.
On 22/09/18 12:08, Carlos Ortega wrote:
> Hola,
>
> ggplot tiene un /geom /justamente para esto...
>
>
2009 Dec 02
1
barchart() {Lattice} -- auto.key()
Hi R Users,
I'm using following data/code (data is also attached) to produce a stacked
barplot.
*I need help with changing legend boxes, currently I'm using
"rectangles=TRUE". Is it possible to get small squares instead -- may be
with a small gap between colored squares.* Currently there is no gap between
the colored rectangles.
# Sample Data:
Names Col1 Col2 Col3
Row1 -20 40
2010 Jul 05
4
Data Labels in a barchart (Lattice or otherwise)
Hi,
Can anyone please help me with how I could add labels with the value for
each bar in a barchart? (similar to how data labels can be added in Excel) I
have done a lot of searching but havent been lucky.
Thanks,
Raoul
--
View this message in context: http://r.789695.n4.nabble.com/Data-Labels-in-a-barchart-Lattice-or-otherwise-tp2278027p2278027.html
Sent from the R help mailing list archive at