Displaying 3 results from an estimated 3 matches for "mywidth".
Did you mean:
mwidth
2007 Dec 01
2
Sweave: Variables in code chunk headers
I would like to be able to do something like this:
<<echo=F,fig=T,width=mywidth>>=
...
@
with mywidth set in a previous code chunk. Is there a way to do this in
Sweave?
(Sorry for two questions in a row, I have been saving these up.)
--
Michael
2007 Dec 01
2
Sweave: Variables in code chunk headers
I would like to be able to do something like this:
<<echo=F,fig=T,width=mywidth>>=
...
@
with mywidth set in a previous code chunk. Is there a way to do this in
Sweave?
(Sorry for two questions in a row, I have been saving these up.)
--
Michael
2011 Aug 20
1
Groups and bwplot
...iate any suggestions to solve these issues:
require(lattice)
mybwplot <- function(x,y,data,groups){
if (missing(groups)||is.null(groups)) {
groups <- NULL
ngroups <- 1
} else {
data[[groups]] <- as.factor(data[[groups]])
ngroups <- nlevels(data[[groups]])
}
mywidth <- 1/(ngroups+1)
mypanel <- function(x,y,groups,...){
if (missing(groups)||is.null(groups)) {
panel.bwplot(x,y,...)
} else {
panel.superpose(x,y,...)
}
}
mypanel.groups <- function(x,y,groups,ngroups,...){
if (missing(groups)||is.null(groups)){
NUL...