Displaying 20 results from an estimated 3000 matches similar to: "Removing inter-bar spaces in barchart"
2013 Jan 22
2
Adding a line to barchart
R-helpers:
I need a quick help with the following graph (I'm a lattice newbie):
require("lattice")
npp=1:5
names(npp)=c("A","B","C","D","E")
barchart(npp,origin=0,box.width=1)
# What I want to do, is add a single vertical line positioned at x = 2 that
lays over the bars (say, using a dotted line). How do I go about doing
this?
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,
2009 Dec 08
3
re-ordering x-lables using barchart()
Hi R Users,
I'm trying to re-order the "site names" ("Waseca", "Morris", ...). I'm using
following code:
libarry(lattice)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(6,1), aspect=.7,
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(abbreviate = TRUE, rot=45,
2011 Aug 23
5
Easier ways to create .Rd files?
R-helpers:
Are there any ways to auto-generate R-friendly (e.g. will pass a
compilation check) .Rd files given a set of .R code? How about GUIs
that help properly format the .Rd files? Thanks! I want a basic set
of .Rd files that I can update as I go, but as with most things my
documentation typically lags behind my coding by a few days.
--j
--
Jonathan A. Greenberg, PhD
Assistant Project
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,
2009 Oct 13
1
Lattice barchart-reordered
Hi,Can I use "reorder" function with barchart as in dotchart? Here are some
codes which do not work for me. Thanks
Chetty
___________________________
a1c.cast$bmi.cat.reordered[a1c.cast$eth!="Other"]
<-with(a1c.cast[a1c.cast$eth!="Other",],reorder(bmi.cat.ordered[a1c.cast$eth!="Other"],
BP.FN.RATE,median ))
barchart(BP.FN.RATE~
2006 Mar 21
5
How to use: library lattice: barchart
Dear ladies and gentlemen!
In the help text for the xyplot (library(lattice), help(xyplot)) is an example
given how one can use barchart:
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(abbreviate = TRUE,
minlength = 5)))
2010 Jan 30
2
Using auto.key with two variable plots
Rhelpers:
Having a problem solving this. I have an xyplot call that looks
like this:
print(xyplot(temp_species_EAM_Pred_Pop$x+temp_species_NULL_Pred_Pop$x~temp_species_EAM_Pred_Pop$Action,main=current_species,
xlab="Action",ylab="Predicted Pop",
xlim=c(xmin,xmax),ylim=c(ymin,ymax),
2009 Oct 23
2
splitting a vector of strings...
Quick question -- if I have a vector of strings that I'd like to split
into two new vectors based on a substring that is inside of each string,
what is the most efficient way to do this? The substring that I want to
split on is multiple characters, if that matters, and it is contained in
every element of the character vector.
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
2009 Dec 02
2
Help: barchart() {Lattice}
Hi R Users,
I'm using following data/code (data is attached also) to produce a stacked
barplot.
# Sample Data:
Names Col1 Col2 Col3
Row1 -20 40 -10
Row2 30 -20 40
Row3 30 10 -20
Row4 20 20 -10
# R Code:
dta<-read.table("data.txt", header=TRUE, row.names="Names")
barchart(data.matrix(dta),
horizontal=FALSE,
stack=TRUE,
par.settings = simpleTheme(col =
2009 Nov 02
2
"Safe" way to automatically install required packages...
R-helpers:
I'm working on an r-package that I want to make as easy-to-use as
possible for a novice R-user, which includes automatically installing
required packages. I, myself, am a novice R-packager, so the solution
I came up with was to embed:
print("Loading required packages...")
if (!require("reshape")) { install.packages("reshape") }
if
2011 Jun 29
1
Querying the path separator?
Hopefully this is a pretty easy fix -- I need to have R query the path
separator for some code I'm trying to write (it involves using a
system() call) -- the call requires a path and a wildcard, e.g.:
command="mycommand /path/to/*.files" in the case of unix or,
command="mycommand.exe C:\\path\\to\\*.files" on a windows box
System.which is working correctly, so the
2010 Jan 28
2
Data frame of different sized lists in a function call
I'm hoping to get some "best practice" feedback for constructing a
function call which takes an undefined set of DIFFERENT length vectors
-- e.g. say we have two lists:
list1=c(1:10)
list2=c(2:4)
lists = data.frame(list1,list2) coerces those two to be the same length
(recycling list2 to fill in the missing rows) -- what is a quick way of
having each of those lists retain their
2009 Aug 27
19
Best R text editors?
Quick informal poll: what is everyone's favorite text editor for working
with R? I'd like to hear from people who are using editors that have
some level of direct R interface (e.g. Tinn-R, Komodo+SciViews). Thanks!
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The
2009 Mar 18
2
How do I set the Windows temporary directory in R?
I'm trying to redirect where temporary files go under R to
D:\temp\somerandomname from its default (C:\Documents and
Settings\username\Temp\somerandomname) -- how do I go about doing this?
--j
--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
2009 Mar 13
2
Using format to add leading zeroes
I have a numerical vector which contains a (poorly) formatted time
column, which, in theory, should be HHMM, but was distributed as an
integer, so, for 12:15 am, it is saved as "15" (e.g. HHMM = 0015 with
the zeroes stripped). I'm trying to use this in conjunction with
strptime, but I'm thinking because each time is an integer ranging from
1 to 4 digits, I probably need to
2010 Jan 22
4
Rotating the axis labels in the basic graphic device ?
Hello dear R help group,
I learned recently that one can change the rotation of labels in the axis,
when using a lattice plot, for example:
library(lattice)
barchart(yield ~ variety , data = barley,
groups = year,
ylab = "Barley Yield (bushels/acre)",
scales = list(rot = 45))
My question is: Is there an application of "rot" in something like
2009 Oct 28
1
Aggregate and cross tabulation
R-helpers:
I have a data frame containing 4 factor variables (let's say A,B,C,
and D) and 1 numerical variable (N). I would like to produce a
cross-tabulated data frame in which A,B,C are individual columns, each
factor of D is its own column, and the field is calculated as a given
function of N (I would like to have two output data frames, one with the
mean(N) and one with the
2010 Jan 20
1
x,y plot question (two sets of labels)
I'm trying to figure out the best way to do a scatterplot using the
following data as an example:
plothelp_x=1:10
plothelp_A1=sin(plothelp_x)
plothelp_A2=tan(plothelp_x)
plothelp_B=c("A","B","C","A","B","C","A","B","C","A")
(note that all 4 of these vectors have 10 entries each)
What I would
2010 Apr 22
1
how to reorder of groups and specify ylim for each row in lattice barchart
R experts,
Is there anyway to reorder inside each group? In the following example, the
bar of year 1932 is always plotted before the bar of year 1931, may I change
the order inside each groups of bars?
library(lattice)
barchart(yield ~ variety | site,data=barley, groups = year, layout =
c(1,6),auto.key = list(points = FALSE, rectangles = TRUE, space =
"right"),ylab = "Barley Yield