similar to: Condional Density Plot from different data

Displaying 20 results from an estimated 7000 matches similar to: "Condional Density Plot from different data"

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
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 <-
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),
2012 Feb 22
2
Several densityplots in single figure
Hi, I have created two separate overlapping density plots- see example code below. What I wish now to do is combine them into one figure where they sit side by side. Any help would be great! many thanks in advance, josh. ##################### thedataA <- data.frame(x1=rnorm(100,1,1),x2=rnorm(100,3,1)) #create data thedataA.m<-melt(thedataA) densityplot(~value, thedataA.m,
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 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 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
2008 Mar 10
2
Multiple density plots
Hi all, I'm interested in doing a multiple density plot on a number of columns in a dataframe. >DF lineA.1 lineA.2 lineB.1 lineB.2 r1 5.355354 6.665575 10.288498 11.74750 r2 3.643415 5.427600 11.407112 13.97065 r3 5.813674 6.438502 9.628871 11.57456 r4 5.241340 5.125049 10.456221 12.35381 r5 4.640885 8.635518 8.344704 11.98484 r6 4.559852 6.416171 10.419599 10.89247 r7
2008 Jun 26
2
density and jpeg
Dear R community, I am using densityplot (lattice package) for a large dataset and wish to print it to a jpeg (the pdf is huge). R crashes consistently. Am I doing it wrong or is densityplot incompatible with jpeg? I work on a Mac, R 2.7.0. > require(lattice) > jpeg("test.jpeg") > d[1:10] [1] 0.700218 0.700175 0.700357 0.700847 0.698286 0.701520 0.698158 0.699300 0.698819
2006 Oct 25
1
density plot text
Is there any way of adding text to a density plot? I have had a go using the text() function but I think the error is because this function doesn't work with densityplot(). Alternatively, I understand I can achieve pretty much the same result if I plot a density kernel estimate using plot() (which allows text()), but I do prefer densityplot(). Also, is it possible to specify the dimensions
2010 Dec 15
1
Problems drawing a colored 'rug' in the Lattice 'densityplot'
Hi All, I'm trying to add a 'rug' representation of my data to a plot created with densityplot(). While I can do this in the simple case, I can't do it properly when I include the "groups" argument. I have an example below. I am running a reasonably new version of R. print(sessionInfo()) R version 2.12.0 Patched (2010-11-07 r53537) Platform: i686-pc-linux-gnu
2012 Nov 20
1
lattice density plot: add vertical lines at groupwise medians for all panels
Suppose you have the following code: ########## Start code########## data(Chem97, package="mlmRev") densityplot(~gcsescore | factor(score), groups=gender, data=Chem97, auto.key=TRUE, plot.points=FALSE, ref=TRUE, panel=function(x,...){ panel.densityplot(x,...) median.values <- median(x)
2010 Dec 21
1
Density plot with lattice?
Hi, Is it possible to remove the points at the base of a density plot?I would like to keep only the curves of the plot, not the points. Thank you. Marie-Helene HacheyM.Sc. studentUniversite Laval, Quebec
2012 Feb 22
1
Lattice and horizontally stacked density plots
Hello, I am try to make a density plot where plots are stacked like the one found here: http://dsarkar.fhcrc.org/lattice/book/images/Figure_14_03_stdBW.png I am facing problems, however. Using the code example below, I'd like to generate a separate panel for each val of id2. Within each panel, I'd like to have individual histograms each on separate lines based on the value of id1. ?Note
2010 Apr 22
2
How to insert gridlines in lattice density plot
Greetings. How can I insert gridlines in the following density plot call? Must one compose a panel function? 'data.frame': 46 obs. of 2 variables: $ fallrates: num 5.2 7.1 7.1 9.8 3.7 7.5 5 6.2 1.5 2.9 ... $ prepost : Factor w/ 2 levels "post","pre": 2 2 2 2 2 2 2 2 2 2 ... library(lattice) densityplot(~fallrates, groups = prepost,
2009 Apr 10
2
Stacked density plots
Hello R-community, I want to generate stacked density plots in lattice. My data consist of a numeric variable ('pid') that is measured in different individuals ('id'), which can be divided in two types ('type') and the measurements were repeated a different time points ('day'). I read in the Lattice book that this can be done using the 'flowViz'
2010 May 11
1
kernel density to smooth plots
Hi r-sers, I have a data of relative frequencies for the interval of 0-20, 20-40,...380-400.  I would like the two data on the same graph using the same x-axis label.  My question is how to get a smooth curve using kernel density code if it possible for this data.   > cbind(rel_obs,rel_gen)           rel_obs rel_gen  [1,] 0.000000000  0.0000  [2,] 0.092534175  0.0712  [3,] 0.105152471  0.1092
2012 Aug 03
2
Density plots
Dear group, I need help on two problems: 1. I am trying to plot density plots for each individual in 8 occasions. I can do this by subject wiht the code below: par(mfrow=c(4,2)) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==0])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==1]))