Displaying 20 results from an estimated 200 matches similar to: "FW: how to enclose two xyplot"
2013 Sep 19
3
lattice: double y - problem changing axis color after doubleYScale
Hi,
I have had some troubles using doubleYScale. No matter what I try, I cant manage to change the color of the y-axis in the end. I have to produce a black and white plot. There is also something I do not understand regarding fontfamilyj="serif" when using it in:
strip=strip.custom()
Maybe someone has a better idea for defining which line and dots belong to which y-axis when not using
2010 Jul 15
4
Sweave: infelicities with lattice graphics
In a paper I'm writing using Sweave, I make use of lattice graphics, but
don't want to explicitly show (or explain)
in the article text the print() wrapper I need in code chunks for the
graphs to appear.
I can solve this by including each chunk twice, with different options,
as in
<<ortho-xyplot1-code, keep.source=TRUE, eval=FALSE>>=
library(nlme)
library(lattice)
2011 May 20
5
regression coefficient for different factors
Dear R-helpers,
In my dataset I have two continuous variable (A and B) and one factor.
I'm investigating the regression between the two variables usign the command
lm(A ~ B, ...)
but now I want to know the regression coefficient (r2) of A vs. B for every factors.
I know that I can obtain this information with excel, but the factor have 68 levels...maybe [r] have a useful command.
Thanks,
2010 Apr 19
2
Overlay of barchart and xyplot
Hello R Folks,
I am new to R. I have been struggling to overlay a barchart with a
xyplot together on one plot but did not get this worked out. Any help
and idea are greatly appreciated.
I attached R scripts for barchart and xyplot below and also data I used.
What I am trying to do is just to put the barchart and xyplot together
on one plot.
Huapeng
<<dispersal_infestation.csv>>
2011 Aug 23
1
histogram with mean for every break
Dear R-users,
I need to produce a histogram where for every breaks there are the mean of the data.
I tried tu use the function >hist(x, break=20 ... ) but this return the numerosity for every breaks, not the mean.
Any hint?
Thanks in advance,
francesco
---------------------------------------
Francesco Nutini
CNR-IREA
Ist. per il Rilevamento Elettromagnetico dell'Ambiente
Via
2012 Jun 05
2
par and complex graph
Dear R-Users, I'd like to have some tips about printing graph.
I use the command par to print more graphs in one window:par(mfrow=c(6,1)); par(oma=c(2.5, 2.5, 2.5, 2.5)); par(mar=c(0.5,4, 0.5, 0.5))
But this command doesn't run with complex graphic command (i.e. xyplot, ternaryplot).How can I print more than one graph per page, when I work with this "elaborated" graph?Many
2011 Jan 31
1
align xyplot
Dear R users,
I'm using xyplot to obtain a graph about a correlation x~y for different years (a categoric variable).
The program dispose automatically the graphs in this way:
2010
2007 2008 2009
2004 2005 2006
2001 2002 2003
1998 1999 2000
Which code should I use to obtain this sequance of graphs?
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010
I have tried with
2010 Dec 03
1
ANCOVA method
Dear [R] Users,
I have implemented a linear model with this syntax:
model<- lm (var_dependent ~ var_indipendent + factor + var_indipendent : factor, dataframe)
anova (model)
Response: var_dependent
Df Sum Sq Mean Sq F value Pr(>F)
var_indipendent 1 20.5522 20.5522 87.8701 1.167e-14 ***
factor 1 0.1060
2010 Dec 09
4
[lattice xyplot] Help needed in help in customizing the panel.abline() function
Hi folks,
I need some help in customizing the abline() function to be used in a
lattice plot. I have attached a reproducible example below.
I need help in the following snippet:
disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type =
"h",lwd=2,panel = function(...) {
panel.abline(v = 8, lty = 2)
panel.xyplot(...)
})
Is there a way I can give
2012 Apr 23
2
automating a script to read a file
Hi,
The following script (which I did not develop) is used to calculate and
plot a skewed normal curve. The script currently requires the user to
input six parameters, rather than reading these directly from a file.
I've been spinning wheels here, trying to figure out how to modify the
script to automate it. I have four data sets, each in excess of 300
records that I need to process.
My
2012 Oct 16
1
vectors comparison
Dear R-Users,
I'd like to have your help on this problem:
I have two vectors:x<- c(0,1,0,0,0,0,0,0,0,0,0,1,0)y<- c(0,0,-10,0,0,-10,0,-10,0,0,0,0,0)
And I want to know where the value -500 in y have a correspondence value 1 in x.Considering a buffer of one position before and after in x.i.e. in this example only the -10 in position y[3] satisfies the criteria, because x has in position
2012 Mar 16
3
Y-axis label on the right hand side in lattice?
Hello,
Is there a way to add ylab on the right hand side also (in lattice)?
Different from the left hand side?
Cheers
Saptarshi
[[alternative HTML version deleted]]
2009 Mar 24
2
Legend containing maths symbol and values of variables
I need to have the maths symbol for >= in the legend, and to
substitute threshold variable with its value. Somehow, various
attempts weren't successful. Please help.
threshold <- 0.5
plot(NA, xlab="", ylab="", main="", axes=F, xlim=c(0,1), ylim=c(0,1),
xaxs="i", yaxs="i")
legend(x=0, y=1, fill=c("orange", "white",
2009 Jun 06
1
stars (as fourfold plots) in plot (symbols don't work)
Hi!
I have a dataset with three columns -the first two refer to x and y
coordinates, the last one are odds ratios.
I'd like to plot the data with x and y coordinates and the odds ratio shown
as a fourfold plot, which I prefer to do using the stars function.
Unfortunately the stars option in symbols is not as cool as the stars
function on its own, and now i can't figure out how to do it!
2012 Sep 23
1
Background color in a grid plot seems to interfere with plot()
Hi,
Why does the upper left panel (in the plot below) not have a gray background?
Cheers,
Marius
require(grid)
require(gridBase)
pdf(file="Rplot.pdf", width=8, height=8, onefile=FALSE)
## set up the grid layout
gl <- grid.layout(5, 5, widths=unit(c(1.8, 8, 0.8, 8, 0.8), "cm"),
heights=unit(c(0.8, 8, 0.8, 8, 1.5), "cm"))
if(FALSE) grid.show.layout(gl)
2009 Jan 15
1
misalignment of x-axis when overlaying two plots using latticeExtra
Dear R-helpers:
I am an entry-level R user and have a question related to overlaying a
barchart and and a xyplot using latticeExtra.
My problem is that when I overlay them I fail to align their x-axes.
I show my problem below through an example.
#the example data frame is provided below
vec <-c(1,5.056656,0.5977967,0.06126587,0.08557778,
2,4.601049,0.5995989,0.05002188,0.11410027,
2010 Sep 10
1
Greek letter included in a character vector
Hello,
In the past I have used "expression" to include greek letters in axis labels,
but this time I need to include the greek letter as part of a legend. Basically,
I need to create the following vector to rename the levels of a factor:
c("Interferon-gamma", "IL-10", "IL-5"), where "gamma" obviously needs to be
printed as the greek letter
2007 Aug 01
5
t-distribution
If I have a calculated t can I get the probability associated with it
using an R function by giving it the df and t? I know I can do the whole
calculation using t.test() or get the t-distribution using qt(). If
t=1.11 and df =9 can I get the probability?
Thanks../Murli
[[alternative HTML version deleted]]
2010 Dec 03
2
difference between linear model & scatterplot matrix
Dear R-users,
I'm studing a DB, structured like this (just a little part of my dataset):
_____________________________________________________________________________________________________________
Site
Latitude
Longitude
Year
Tot-Prod
Total_Density
dmp
Dendoudi-1
15.441964
-13.540179
2005
3271.16
1007
16993.25
Dendoudi-2
15.397321
-13.611607
2010 May 26
1
persp(); help with 'tck' option
Hi All,
I'm using 'tck' option to *reduce* the length of tick marks but it is not
working, can anyone please tell me where I'm going wrong...
require(graphics)
require(grDevices)
x <- seq(-10, 10, length= 30)
y <- x
f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r }
z <- outer(x, y, f)
z[is.na(z)] <- 1
# 'bg' works but 'tck' is not showing