Displaying 20 results from an estimated 96 matches for "barley".
Did you mean:
bailey
2005 Oct 27
2
RSQLite problems
...ed in the SQL statement.
2. A newline '\n' line attached to the last string value of each row.
Some examples:
> library (RSQLite)
Loading required package: DBI
> sqlite <- dbDriver ("SQLite")
> db <- dbConnect (sqlite, dbname = "test.dbms")
> data (barley)
> dbWriteTable (db, "barley", barley, overwrite = TRUE)
[1] TRUE
> barley[1:3,]
yield variety year site
1 27.00000 Manchuria 1931 University Farm
2 48.86667 Manchuria 1931 Waseca
3 27.43334 Manchuria 1931 Morris
> dbReadTable (db, "barley...
2006 Jul 07
2
dotplot (lattice) with panel.segments and groups
...e 'panel.dotplot' call (commented) generates the error 'Error in
NextMethod("[") : argument "subscripts" is missing, with no default'. The
other problem is that the colors alternate between the levels of the 'site'
variable, rather than 'year'.
barley$yield2 <- with(barley, yield + 5)
dotplot(site ~ yield | variety, data=barley, groups=year,
yield2=barley$yield2, col=c("gray", "black"),
panel=function(x, y, subscripts, yield2, ...) {
## panel.dotplot(x, y, ...)
panel.segments(x, as....
2004 Feb 12
2
lattice: showing panels for factor levels with no values
How to show panels for factor levels of conditioning variables
which do have no values?
E.g. there are panels for "Grand Rapids" when they have values:
data( barley )
with( barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) )
There are no panels for "Grand Rapids"
when there are no values for "Grand Rapids":
my.barley <- subset( barley, ! ( site == "Grand Rapids" ) )
with( my.barley, dotplot(variety ~ yield | ye...
2012 Nov 15
1
strip.custom() with more than one conditioning variable
Suppose I wanted to plot the barley data like this:
dotplot(variety ~ yield | year+ site, barley,
strip = strip.custom(style = 4))
The factor levels are far too long for that to be useful. I can
overcome that problem if I shorten the levels like this:
dotplot(variety ~ yield | year + site, barley,...
2006 Dec 08
1
lattice: defining an own function using args for "formula" and "groups"
x.fun <- function( formula, data ) dotplot( formula, data )
x.grp <- function( formula, groups, data ) dotplot( formula, groups, data )
data( barley )
> x.fun( variety ~ yield | site, data=barley )
# no problem
> dotplot( variety ~ yield | site, groups=year, data=barley )
# no problem
> x.grp( variety ~ yield | site, groups=year, data=barley )
object "year" not found # that's my error, so I do:
> x.grp( variety ~...
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, minlength =
5)))
Can anyone help please.
-Gary
[[alternative HTML version deleted]]
2006 Jan 25
2
panel function with barchart (lattice)
...in 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,
groups = year,
layout = c(1,6),
stack=TRUE,
ylab = "Barley Yield (bushels/acre)"
)
To do this, I add my panel function:
barchart(yield ~ variety | site, data = barley,
groups = year,
layout = c(1,6),
stack=TRUE,
ylab = "Barley Yield (bushels/acre)",
panel = function...
2004 Sep 13
1
Adding ranks to a repeatedly ragged array
How can I add an extra column containing the rank
to a ragged array indexed by more than one grouping
factors?
E.g. with the barley dataset:
How can I to add an additional column ``rank''
containing the rank of the ``yield'' of
the different varieties in relation to the indices
``year'' and ``site'' to the barley dataframe?
I achieved to calculate the ranks with:
rank.lists <-
with( barley...
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,
minlength = 5)))
I want to sort the yield value, in "waseca" site (e.g.), according the group
of...
2010 Dec 06
2
ggplot2: Controlling line width of panel borders
Dear R-users,
i encountered some problems when trying to adjust the line width of the
axes and stripes in a plot created with ggplot2.
I use the "barley" dataset of the lattice package to illustrate my problem:
library(ggplot2)
library(lattice)
barley[["SD"]] <- 5
limits <- aes(ymax=barley$yield + barley$SD,ymin=barley$yield - barley$SD)
p1 <- ggplot(barley,aes(fill=year,y=yield,x=variety))
p2 <- p1 + geom_bar(positi...
2010 Jan 24
2
different x-axes in Lattice
...uild a chart. I have a
problem with setting different x-axes. Some x categories are missing
but they are display and I don't want. I use scales = list(y =
"free",x="free") but it works only for y-axes. Simple example:
package(lattice)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
scales = list(y = "free",x="free"),
auto.key=list(rectangles = TRUE, space = "bottom"),
)
Let's assume that in the first panel 'Waseca' the category 'Velvet'
are not available in da...
2018 Apr 24
2
[FORGED] Extracting specified pages from a lattice ("trellis") object.
...corresponding levels of the conditioning variable(s). Note that, if
there is more than one conditioning variable, you will need more than
one subsetting index.
For example, taking this plot with two conditioning variables and 12
panels in total ...
dotplot(variety ~ yield | year * site, data=barley)
... this produces three pages ...
dotplot(variety ~ yield | year * site, data=barley,
layout=c(2,2))
... and this produces the second page (both panels for the first
conditioning variable and the third and fourth panels for the second
conditioning variable) ...
dotplot(variety ~ yie...
2004 Sep 29
2
lattice .ps graphic is rotated in LaTeX slides
I've generated a version of the classic dotplot of the barley data with
library(lattice)
data(barley)
trellis.device("postscript", color=TRUE, file="barley2x3.ps")
old.settings <- trellis.par.get()
trellis.par.set("background", list(col = "white"))
lset(list(superpose.symbol=list(pch=c(19, 1, 25, 2, 15, 22, 23),...
2010 Mar 22
2
using reorder in "dotplot"
Hi ,
Name
rate
HEALTHALLIANCE HOSPITALS, INC -1.06211747
MOUNT AUBURN HOSPITAL 0.50960291
STURDY MEMORIAL HOSPITAL 2.64233232
LAWRENCE GENERAL HOSPITAL 2.15628558
CAMBRIDGE HEALTH ALLIANCE 1.23623144
I would like use
2018 Apr 24
0
[FORGED] Extracting specified pages from a lattice ("trellis") object.
...ioning variable(s).? Note that, if
> there is more than one conditioning variable, you will need more than
> one subsetting index.
>
> For example, taking this plot with two conditioning variables and 12
> panels in total ...
>
> dotplot(variety ~ yield | year * site, data=barley)
>
> ... this produces three pages ...
>
> dotplot(variety ~ yield | year * site, data=barley,
> ??????? layout=c(2,2))
>
> ... and this produces the second page (both panels for the first
> conditioning variable and the third and fourth panels for the second
> cond...
2005 Jun 01
1
font size in the trellis plot
>library(lattice)
>dotplot(variety ~ yield | site, data = barley, groups = year,
key = simpleKey(levels(barley$year), space = "right"),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6), ylab=NULL)
and i get the plot whose font overlaps .what parematers should i change.(i do not want to...
2018 Apr 27
1
[FORGED] Extracting specified pages from a lattice ("trellis") object.
Hi
Does this not do what you want ... ?
allpages <- dotplot(variety ~ yield | year * site, data=barley,
layout=c(2,2))
page2 <- allpages[1:2, 3:4]
print(page2)
Paul
On 24/04/18 17:51, Rolf Turner wrote:
>
> On 24/04/18 15:17, Paul Murrell wrote:
>
>> Hi
>>
>> I think the subsetting works by giving you the panels for the
>> corresponding l...
2007 Jan 30
1
change plotting symbol for groups in trellis graph
Hi,
how can I change the plotting symbol for the groups in a trellis panel dotplot.
My graph is similar to:
library(trellis)
dotplot(variety ~ yield | site, data = barley, groups = year,
key = simpleKey(levels(barley$year), space = "right"),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6), ylab=NULL)
I'd like to plot the different years with different symbols (eg. one
with pch=19 the...
2009 Feb 19
2
dotplot points color
Dear list,
is it possible to change the background color of dotplot's points? I tried
in many ways but unsuccessfully
Thanks in advance
Gianandrea
require(lattice)
dotplot(variety ~ yield | site, data = barley, groups = year, pch=21)
dotplot(variety ~ yield | site, data = barley, groups = year, pch=21,
bg=c("2","3")) ??!!!
--
View this message in context: http://www.nabble.com/dotplot-points-color-tp22099530p22099530.html
Sent from the R help mailing list archive at Nabble.com.
2009 Sep 26
1
Lattice, stripplot (xyplot), plotting data with median line, numeric x-axis
All,
On p.52 of Deepayan Sarkar's Lattice book there is a nice plot of showing
residuals with median lines superimposed or various groups:
library("lattice")
stripplot(sqrt(abs(residuals(lm(yield~variety+year+site)))) ~ site,
data = barley, groups = year, jitter.data = TRUE, type = c("p", "a"), fun =
median)
Suppose we wanted to make a similar plot for a numeric x-axis. Is there any
way to do this with stripplot or does one have to xyplot and presumably
panel functionality to get the median line? This does not...