Thanks Rich,
but, ....
Suppose the data.frame element (i.e., the column or variable) has a
different name (e.g., y1) than the function element (e.g., v1).
Example:
tmp <- data.frame (y1 = rnorm(50))
This renders the same problem that I was encountering before. The object in
the function "v1" was not found when running the program.
The program works in the example Rich provides because the example has the
same variable name in the data.frame as the function. The function I have
tried to write appears to not be generalizable. So, I am still missing
something in the program.
Thanks for any help,
Tom
Rich's revision of the program:
uni.g <- function(v1, dat, split=c(1, 1, 2, 2), more=F)
{
a <- bwplot(~v1, data=dat)
result <- print(a, split=split, more=more)
invisible(result)
}
## uni.g(VARNAME,DATAFRAME)
tmp <- data.frame(v1=1:10)
uni.g(v1, tmp, more=T)
uni.g(v1, tmp, split=c(2, 2, 2, 2))
|