Displaying 20 results from an estimated 8000 matches similar to: "scales argument in bwplot (lattice)"
2010 Dec 09
1
Condional Density Plot from different data
I'm not certain I am using the lattice plot correctly here. Below is reproducible code. Suppose I have two data frames, such as:
set.seed(1234)
datA <- data.frame(condition = gl(3, 100), scores = c(rnorm(100), rnorm(100, 1,1), rnorm(100, 2,1)))
datB <- data.frame(condition = gl(3, 1000), scores = c(rnorm(1000, 3,1), rnorm(1000, 4,1), rnorm(1000, 5,1)))
I would like to plot the
2011 Feb 04
4
aggregate function - na.action
Can someone please tell me what is up with na.action in aggregate?
My (somewhat) reproducible example:
(I say somewhat because some lines wouldn't run in a separate session, more
below)
set.seed(100)
dat=data.frame(
x1=sample(c(NA,'m','f'), 100, replace=TRUE),
x2=sample(c(NA, 1:10), 100, replace=TRUE),
x3=sample(c(NA,letters[1:5]), 100, replace=TRUE),
2011 Mar 10
1
Lattice: Feature Request
Hi,
I'm currently designing some global themes for use with lattice, and have
hit a snag. There doesn't appear to be (in xyplot at least) a way of setting
a lattice option for the 'scales' parameter at a global level - changes have
to be made in each function call. For example, consider the following code:
library(lattice)
library(latticeExtra)
# Create some data
temp <-
2010 Nov 29
1
Sweave choking on \\ in filename
Dear all,
Sweave chokes when using "\\" in the path to the Rnw file. Using "/"
works fine. The problem is that Eclipse+StatET uses "\\" in the
filename.
And example of the error, traceback and sessionInfo are given below.
Best regards,
Thierry
> Sweave("Q:\\BMK\\cursussen\\interne_opleiding\\deelnemerslijst.Rnw",
syntax="SweaveSyntaxNoweb")
2010 Dec 06
1
lattice: strip panel function question
Dear list,
If have some repeated measurement data which looks something like:
time <- rep(1:5 , each=2*4)
groups <- rep(c("Case", "Control"), each=4)
subjects <- factor(rep(1:(2*4), 5))
responses <- time + rnorm(5*2*4) + as.integer(factor(groups))
data <- data.frame(responses, time, groups, subjects)
Now I want to plot each subject in a separate panel:
2010 Mar 19
3
strange behavior, adds new field by non-existent field
data:
> tmp1
Date HrMn Temp Q.4
1 19450101 0900 -37.0 1
2 19450101 1000 -35.9 2
3 19450101 1100 -35.9 3
4 19450101 1200 -36.4 4
5 19450101 1300 -36.4 5
6 19450101 1400 -36.4 6
7 19450101 1500 -36.4 7
8 19450101 1600 -37.5 9
Accidentally, I did this (I meant to write Q.4 instead of Q here)
> tmp1$Q[tmp1$Q!="1" & tmp1$Q!= "5"]<-NA
I would
2009 Sep 30
1
bwplot scales in alphabetical order
Dear List,
I know this has been covered before, but I don't seem to be able to get it right. I am constructing a boxplot in lattice and can't get the scales in the correct alphebetical order. I have already read that this is due to the way factors are treated, and I have to redefine the levels of the factors. However, I have failed.
As a simple example:
library(lattice)
2006 Feb 11
2
aggregate vs tapply; is there a middle ground?
Dear all,
I'm wanting to do a series of comparisons among 4 categorical variables:
a <- aggregate(y, list(var1, var2, var3, var4), sum)
This gets me a very nice 2-dimensional data frame with one column per
variable, BUT, as help for aggregate says, <<empty subsets are
removed>>. I don't see in help(aggregate) how I can change this.
In contrast,
a <- tapply(y,
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 <-
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
2009 Dec 03
1
how to use different ylim scales on a lattice bwplot?
A colleague is interested in modifying the ylim definition for individual
panels of a common bwplot plotting statement.
Is there an approach to modifying the bwplot function to allow for a
dynamic ylim range given different panel factors ?
He is using R 2.6.2 on a Linux distribution running from a CD.
Thanks for the assistance.
Steve
Steve Friedman Ph. D.
Spatial Statistical Analyst
2010 Oct 19
1
DLL not found
Dear R-helpers,
I have a fresh installation of windows vista, and R 2.12.0 (session info below).
Problem:
> require(sp)
Loading required package: sp
Error in library.dynam(lib, package, package.lib) :
DLL 'lattice' not found: maybe not installed for this architecture?
> require(lattice)
Loading required package: lattice
Failed with error: ?package 'lattice' is not
2010 Nov 12
2
Surprising behavior using seq()
Hello R-help,
I noticed the following surprising behavior when using %in% to find elements in a vector generated using seq().
# weird!!!
> c(7.7, 7.8, 7.9) %in% seq(4, 8, by=0.1)
[1] TRUE FALSE TRUE
# OK now
> c(7.7, 7.8, 7.9) %in% round(seq(4, 8, by=0.1), 1)
[1] TRUE TRUE TRUE
# wait, how is this different?
> c(7.7, 7.8, 7.9) %in% seq(7, 8, by=0.1)
[1] TRUE TRUE TRUE
Is there an
2010 Nov 07
1
Rdindex truncating titles?
When building packages these days I keep getting warnings from
"R CMD build" to the effect that INDEX is not up to date. The
INDEXes always seem to be up do to date to *me*.
Then I thought to compare the INDEX from the package source with
the INDEX in the installed package (after building with the --force
flag set).
Doing a diff on the old INDEX (saved outside the source package
2010 Oct 04
1
Help with apply
Suppose I have the following data:
tmp <- data.frame(var1 = sample(c(0:10), 3, replace = TRUE), var2 = sample(c(0:10), 3, replace = TRUE), var3 = sample(c(0:10), 3, replace = TRUE))
I can run the following double loop and yield what I want in the end (rr1) as:
library(statmod)
Q <- 2
b <- runif(3)
qq <- gauss.quad.prob(Q, dist = 'normal', mu = 0, sigma=1)
rr1 <- matrix(0,
2010 Nov 11
3
User input after opening graphing device
If I run the following:
> windows()
>
> bringToTop(-1)
>
> interactive()
[1] TRUE
>
> run <- readline(prompt = "Continue (Yes = 1, No = 2):")
Continue (Yes = 1, No = 2):
> dummy <- 1
> run
[1] ""
it does not allow user input though the session is interactive (it jumps right over the readline command).
It would be great
2010 Oct 28
2
R and Matlab
Dear Group,
I am looking for ways to use R and Matlab. Doing the data transformations in
R and using the data in Matlab to analyze with some pre-defined scripts.
Any good ways to transfer the data into matlab in its most recent version?
I tried using R.matlab but the writeMat output is not readable by Matlab.
I just need to output a data.frame and read it as is into matlab where I can
do any
2010 Nov 02
1
Display of NAs in character columns of a data frame under fix() or edit().
Example:
xxx <- data.frame(x=1:26,y=letters)
xxx$x[c(2,4,6,8)] <- NA
xxx$y[c(1,3,5,7)] <- NA
yyy <- edit(yyy)
The missing values in xxx$y appear as blanks in the spreadsheet window that
appears, whereas the missing values in the numeric column "x" appear as "NA"
(as I would expect).
Is this a bug or a feature?
cheers,
Rolf Turner
P.S.
>
2011 Jan 27
1
Can not invoke maxent() of library(dismo) in GNU linux
Dear R-helpers and Dr. Hijmans,
I can not invoke maxent() in GNU Linux. Could you give me any directions
on that? There is maxent.jar in version 3.3.3e in the right folder.
########################################
R:
> jar <- paste(system.file(package="dismo"), "/java/maxent.jar", sep='')
> jar
[1] "/ebio/abt6/jmao/rpacks/dismo/java/maxent.jar"