Displaying 20 results from an estimated 2000 matches similar to: "Data Labels in a barchart (Lattice or otherwise)"
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,
2010 Jun 26
7
Calculating Summaries for each level of a Categorical variable
Hi,
I have a dataset which has a categorical variable "R",a count variable C
(integer) and 4 or more numeric variables (A,T,W,H - integers) containing
measures for "R". I would like to summarize each level of the variable R by
the average for A,T,W and H.
I have written a function to calculate weighted averages using C as the
weight and this is given below. The function
Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question
2009 May 18
1
Barchart in lattice - wrong order of groups, data labels on top of each other, and a legend question
Hello!
I have a question about my lattice barchart that I am trying to build
in Section 3 below. I can't figure out a couple of things:
1. When I look at the dataframe "test" that I am trying to plot, it
looks right to me (the group "Total" is always the first out of 5).
However, in the chart it is the last. Why?
2. How can I make sure the value labels (on y) are not
2010 Dec 21
1
Coding a new variable based on criteria in a dataset
Hi,
I'm a bit stuck and need some help with R code to code a variable F_R based
on a combination of conditions.
The first condition would code F_R as "F" and would be based on the
min(Date) and Min(Time) for each combination of UniqueID & Reason. The
second condition would code the variable as "R" as it would be the rest of
the data that dont meet the first
2010 Oct 03
1
Help with panel.text in Lattice - Putting labels for co-oridnates in a plot
Hi,
I am trying to create a Lattice dotplot that has the following data graphed.
I need to put labels for each of the co-oridnates on the plot. I have
managed to get only one label dispalyed as I don't completely understand the
"panel.text" function. Can someone please help me?
# Sub Reason is a text field that I need to see the volumes for (Vols)
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
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,
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),
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
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),
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 May 07
2
graphing with barchart question
I am graphing data using barchart (barchart(DV ~ IV | subject). I
have 2 groups of 9 subjects each. How can I easily identify which
group each subject belongs to? I have been trying to color code them,
but can't seem to get that to work. Any suggestions would be
appreciated.
Thanks,
Matt Bridgman
2008 Feb 03
2
(Small) problem with barchart
Hi,
I have a small problem when using barchart. I have the following data:
letters a
6 f 18
1 a 15
10 j 12
9 i 12
4 d 9
5 e 6
The data is from a survey and summaries the alternatives selected in one
question. The idea is to have a bar chart illustrating the count of
each selection in descending order. The data frame is already ordered
in
2010 May 07
3
How to sort a grouped barchart?
Hi,
I have a barchart very similar to the example on the function documetation,
however, I want to sort the bars according one group in one panel.
Reminding:
library(lattice)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
ylab = "Barley Yield (bushels/acre)", auto.key=list(),
scales = list(x = list(abbreviate = TRUE,
2010 Jan 14
3
Barchart bar lengths not proportionate
When I use barchart (with default formatting options), I get bars whose
lengths/heights are not proportional to their value. For example:
http://drop.io/wbagm6s/asset/capture-png
Many of the values in this chart are 1; however, because the blue bars
extend to the left of the "0" tick mark, those bars appear to represent
higher numeric values. Is there a way to make the length of the
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)
2010 Aug 25
2
Removing inter-bar spaces in barchart
Rhelpers:
I'm trying to make a barchart of a 2-group dataset
(barchart(x~y,data=data,groups=z,horizontal=FALSE)). My problem is
that I can't, for the life of me, seem to get rid of the inter-bar
space -- box.ratio set to 10000 doesn't do much. Any ideas? I'd
ideally want zero space between the bars. Thanks!
--j
--
Jonathan A. Greenberg, PhD
Assistant Project Scientist
2003 May 13
2
Barchart to make a graph like this??
Hi list,
I'm trying to get R to make a graph like the one shown in this pdf, where
males are white bars and females are black bars.
http://www.brrc.unr.edu/~knussear/mmgraph.pdf
I tried barchart, but I couldnt get the bars to share a common x axis.
Do you have any suggestions?
Thanks for your help
Ken