Displaying 20 results from an estimated 8000 matches similar to: "lattice multiple y-scale possible?"
2011 May 19
1
Creating a "shifted" month (one that starts not on the first of each month but on another date)
Hello!
I have a data frame with dates. I need to create a new "month" that
starts on the 20th of each month - because I'll need to aggregate my
data later by that "shifted" month.
I wrote the code below and it works. However, I was wondering if there
is some ready-made function in some package - that makes it
easier/more elegant?
Thanks a lot!
# Example data:
2011 Jul 21
2
Quantreg-rq crashing trouble
Hi
I am using the quantreg package for median regression for a large series
of subsets of data. It works fabulously for all but one subset. When it
reaches this subset, R takes the command and never responds. I end up
having to kill R and restart it.
It appears to be something with the particular data subset, but I can't
pinpoint the problem.
Here are some details
Operating system:
2011 Mar 26
1
bwplot [lattice]: how to get different y-axis scales for each row?
Dear expeRts,
How can I get ...
(1) different y-axis scales for each row
(2) while having the same y-axis scales for different columns?
I coulnd't manage to do this with relation="free" [which gives (1) but not (2)].
I also tried relation="sliced", but it did not give the same y-axis scales
within each row (see the fourth row). Further, it "separates" the
2006 May 17
1
boxplot
I am running this code to produce some boxplots. I have every thing that
I need except that I would like the whisker line to be solid line, not
dashes. I have reviewed the lattice docs but have not seemed to come
across this point.
print( bwplot( group ~ lpcb_tot, data= data7, xlab="Log PCB",
+ ylab=
+ " G B
+ S M S M
2010 Oct 13
4
Change global env variables from within a function
Hi,
I've looked all over for a solution to this, but haven't had much look
in specifying what I want to do with appropriate search terms. Thus I'm
turning to R-help.
In the process of trying to write a simple function to rename individual
column names in a data frame, I ran into the following problem: When I
rename the columns within my function, I can't seem to get it to
2011 May 17
1
scales argument in bwplot (lattice)
Suppose I have data such as the following
set.seed(12345)
tmp <- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3=rnorm(100, 10, 30))
tmp1 <- data.frame(vars = with(tmp, c(var1, var2, var3)), type = gl(3, 100))
var3 is on a different scale, but I create the following plot, which looks terrible as a result
bwplot(~ vars|type, tmp1,
layout = c(1,3),
)
Of course, I can
2010 Oct 11
1
Lattice::bwplot unexpected behaviour when using vector of colors
Hi,
I'm trying to produce colored boxplots using lattice::bwplot function. I need to plot each boxplot in the panel with a specific color. Naturally I used a vector of colors and expected to see colored boxplots. Although the boxplots were colored, the color of whiskers and the boxes do not match. Here is an example:
d = data.frame(y = rnorm(100), x=1:4)
box.color <-
2010 Oct 11
1
Lattice::bwplot unexpected behaviour when using vector of colors
Hi,
I'm trying to produce colored boxplots using lattice::bwplot function. I need to plot each boxplot in the panel with a specific color. Naturally I used a vector of colors and expected to see colored boxplots. Although the boxplots were colored, the color of whiskers and the boxes do not match. Here is an example:
d = data.frame(y = rnorm(100), x=1:4)
box.color <-
2005 Mar 23
2
alternative to 'groups' for lattice bwplot()
Hi,
Is there some alternative to the 'groups' argument in lattice's bwplot
function for boxplots? Say in the example below:
bwplot(yield ~ site | year, data = barley)
you want to have two side by side boxplots per site, corresponding to each
year in the barley data frame. Ideally, the space between boxplots of the
same site should be smaller than that between boxplots of different
2010 May 24
1
lattice 'scales' option help
Hi All,
I'm trying to draw boxplots. I'm having a hard time to get "ticks labels" on
multiple panels using 'alternating' option.
# R Code:
# May not be the best example, please just look into 'scales' option
library(lattice)
data(OrchardSprays)
dta <- subset(OrchardSprays, OrchardSprays$rowpos %in% c(1,2,3))
# Original
# This works fine, as you can see
2013 Mar 13
2
Extract letters from a column
Dear list:
I would like to extract three letters from first and second elements
in one column and make a new column.
For example below,
> tempdf = read.table("clipboard", header=T, sep='\t')
> tempdf
name var1 var2 abb
1 Tom Cruiser 1 6 TomCru
2 Bread Pett 2 5 BrePet
3 Arnold Schwiezer 3 7 ArnSch
> (p1 =
2010 Mar 01
3
help with lattice boxplots...
Hi All,
I need a small help with following code: I'm trying to convert "dashed
lines" to regular ones; and changing default "blue" border color to say
"black"... but I'm doing it wrong and its not working. Can anyone help
please. Thanks,
Code:
require(lattice)
ex <- data.frame(x=1:10, y=rep(c("A","B"), 5))
bwplot(y~x, data=ex,
2007 May 12
1
function similar to "get" that works for both an object, and elements of an object?
#Is there a single function similar to "get" that works for both an object, and elements of an object ?
#(I want the function to be able to return objects, and/or the deeper elements of an object.)
#(i.e. elements of a dataframe and/or list)?
#e.g.
tempdf = data.frame(a=c(4,5,6) , b=c(10,11,12) )
templist= list(x=tempdf, y=c(1,2))
get('tempdf') #works as desired
2005 Jun 14
2
lattice, panel.grid, and scales=list(tick.number=XXX)
I have a Lattice plot in which I want to adjust the number of tick
marks used, and I want to have the drawn grid reflect that change.
Here is what I'm doing:
bwplot(var1 ~ var2, data=df, scales=list(tick.number=10),
panel=function(...) {
panel.grid(h=0,v=-1,...);
panel.stripplot(col="gray40", pch="|", cex=2, ...);
panel.bwplot(...);
})
2011 Feb 22
1
how can I connect paired points within lattice bwplot?
Hello all,
my first post to this list. I do a lot of experiments using a paired
sampling design and I would get a lot of mileage out of figures like
this, if I can make it work! Any advice would be appreciated.
my email is: cory.champagn at gmail.com.
Thanks!
#define dummy variables and a dataframe:
y1 <- c(1:20)
x1 <-
2009 Jan 08
2
lattice question: independent per-row or per-column scaling?
Hello - and happy newyear to all of you!
I've got some data that I'm plotting with bwplot, a 3x2x3 design where
the observable decreases with the principle independent factor, but at
different rates.
I'd like to get lattice to impose not a single set of axes ranges
identical for all panels, but ranges that are identical for each panel
row or each column. Effects will stand out much
2013 Apr 07
4
Same boxplot colors by panels in lattice (bwplot)
Dear all,
I would like to have the same color for the all boxplots from the same
panel, but my code below shows the two colors alternating. Thanks!
set.seed(42)
D1 <- rnorm(200)
D2 <- factor(sample(letters[1:2],200,TRUE))
D3 <- factor(sample(letters[3:5],200,TRUE))
DF <- data.frame(x=D1,a=D2,b=D3)
print(bwplot(b~x|a,data=DF,col=c("black","black"),
2010 Feb 26
1
bwplot() {lattice}
Hi All,
I'm trying to plot boxplot graph. I tried barchart with "groups=" option and
it worked fine. But when I try to generate same kind of graph using
bwplot(), "groups=" option doesn't seem to work. Though this works,
yield ~ variety | site * year
I'm thinking why "groups=" doesn't work in this case, can anyone help
please...
#Code:
2004 Aug 03
1
(Lattice) How to improve the readability of a bwplot, i.e. separating groups somehow
Hi all,
first of all thanks for the answer to my previous question on lattice some
time ago.
In particular to Patrick Connolly for advices on netiquette (I hope this
time I'm doing right....)
and to Deepayan Sarkar fro the help on lattice.
Now, my nowaday problem.
Please consider the following
mydf<-cbind.data.frame(
RESPONSE = c(rnorm(9,rep(2:4,each=3),10),
2010 Nov 02
1
Colour filling in panel.bwplot from lattice
Inspired by colouring the dots of box-whisker plots I am trying to also
fill the boxes (rectangles) with different colours. This seems not to
work as I expected.
Looking at the help page of panel.bwplot it says: 'fill - color to fill
the boxplot'. Obviously it is only intended to fill all boxes with only
one colour?
Nevertheless the following example shows, that 'fill' from