search for: densityplot

Displaying 20 results from an estimated 99 matches for "densityplot".

2006 Dec 01
3
Vertical line in densityplot?
Hi all, I'm trying to get a vertical line at a specific point in a densityplot. abline seems to be what's required, but it doesn't align itself to the scale used in the plot. example: library(lattice) x<-rnorm(100) plot.new() densityplot(x) abline(v=0) ----- The line seems to use some other coordinate system. What kind of call do I use to make abline use the grap...
2012 Feb 22
2
Several densityplots in single figure
...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, groups=variable,auto.key=list(columns=2), panel = function(x, y, ...) { panel.densityplot(x, ...) panel.abline(v=0) } ) thedataB <- data.frame(x1=rnorm(100,2,1),x2=rnorm(100,4,1)) #create data thedataB.m<-melt(thedataA) density...
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 (32-bit) local...
2008 Aug 26
2
awkward behavior with densityplot function
Hi, I have the following script: ---- t.R --- grafica <- function() { v <- read.csv('preprocessed/komolongma.ece.uprm.edu.active',sep=',') x <- as.ts(v$active) bitmap(file="output.png") densityplot(~x,col='blue',main='Density Plot') dev.off() } grafica() ---- t.R --- When I "sourced" it from R prompt, it quietly runs. However the "output.png" generated contains any visible data. I said that, because the file is created and it has 2062 bytes. --- execu...
2006 Jun 26
1
How to generate a figure using par( ) with some densityplot( )'s
Hi Dear R users, For a pair plotting, usaully we use par( ) function. Apparently it does not work anywhere. I want to have 3 plots in a single figure, like this: par(mfrow=c(3,1)) densityplot( a) densityplot(b) densityplot(c) But it does not work. How is it possible to have such a figure with densityplot( ) in a single figure? So many thanks for any help. Amir Safari --------------------------------- [[alternative HTML version deleted]]
2007 Aug 21
1
small issue with densityplot
Hi folks, This is really minor but to someone not familiar with the various tentacles of the lmer package it could be really annoying. I was trying to plot the posterior density of the fixed effect parameters of a lmer model, > hr.mcmc = mcmcsamp(hr.lmer, n=50000) > densityplot(hr.mcmc, plot.points=F) There is this error, "Error in densityplot(hr.mcmc, plot.points = F) : no applicable method for "densityplot" " It kind of smells like something I've come across before. So I checked the mcmcsamp help page, and alas, the example suggests t...
2011 Jul 27
1
How to adjust y-axis when using panel.densityplot within histogram function
Hi I would like to superimpose group-specific densityplots on top of an overall histogram using panel.histogram and panel.densityplot. Furthermore, I would like to automatically adjust the range of the y-axis to take into account the ranges of both histogram and densityplot. This last part is where I have a problem. I believe using the prepanel argument o...
2008 Dec 11
2
call lattice function in a function passing "groups" argument
I'm trying to use a lattice function within a function and have problems passing the "groups" argument properly. Let's say I have a data frame d <- data.frame(x = rnorm(100), y = c("a", "b")) and want to plot variable x in a densityplot, grouped by the variable y, then I would do something like densityplot(~ x, d, groups = y) If however I wanted to call the function "densityplot" within a function and pass the "groups" argument as an argument of that function, how would I have to proceed? It is not as stra...
2012 Apr 11
1
Lattice densityplot with semitransparent filled regions
...mpts I get something very near what I need, but I don't solve the problem of use semitransparent filled. Below a minimal reproducible code. Someone has any idea? require(lattice) # toy data... dt <- expand.grid(A=1:2, B=1:3, y=1:50) dt$y <- rnorm(nrow(dt), dt$B, dt$A) # regular plot... densityplot(~y|B, groups=A, data=dt, plot.points="rug") # the actual panel... panel.densityplot # so, I edit this... my.panel.densityplot <- function (x, darg = list(n = 30), plot.points = "jitter", ref = FALSE, groups = NULL, weights = NULL, jitter.amount = 0.01 * diff(current.pan...
2009 Dec 16
2
problem with a densityplot
Hi, i have a script how i launch lattice to make a densityplot. in the script: jpeg(file="XXX.jpg") densityplot(~f_diametro+m_diametro+n_diametro, plot.points="rug", auto.key=T) dev.off() does'nt work and in R i dont have any output but if i launch by R row by row, runs correctly..... any idea?
2006 Jul 07
1
densityplot and panel.groups
I am trying to plot multiple densityplots on each panel, and using panel.groups to do some additional plotting (not included in the example) as in this example. library(lattice) thedata <- data.frame(x=rnorm(1200),class=rep(1:3,each=200,times=2), group=rep(1:2,each=100,times=6)) densityplot(~x | class,groups=group, xlab='x...
2010 Jul 16
1
Weighted densityplot?
...ata are of the form: I, J, Actual, Distance, Subset, Weight1, Weight2, ... I'm trying to see the effect of the distance distribution (Actual by Distance) compared to the various weighted distributions (Subset*WeightX by Distance) I presume I and J are the subscripts to the weight Variable in densityplot. If anyone has a code snippet of densityplot using weights, I could get started.... Thanks in advance, Robert Farley Metro 1 Gateway Plaza Mail Stop 99-23-7 Los Angeles, CA 90012-2952 Voice: (213)922-2532 Fax: (213)922-2868 www.Metro.net [[alternative HTML version deleted]]
2011 Oct 04
0
Adding multiple gates/filters in densityplot
Hi R-Users, I posted this question a while ago on the bioconductor mailing list but got no answers. Maybe here is somebody who might know a solution: I failed at drawing multiple filters in a densityplot() using the FlowCore/FlowViz packages. I found a way to draw multiple filters in xyplot(), using the glpolygon method within the panel-function, but some similar attempts for densityplot failed. I could draw simply some vertical lines using panel.abline, but this doesn't look as appealing a...
2013 Feb 13
1
densityplot(~x+y) for vectors of different lengths does what?
densityplot(~x+y) does what I expect it to do if x and y have equal length. I know how to get what I want if x and y have different lengths. But what is this actually doing if x and y have different lengths? The relevant example is x=rnorm(10) y=rnorm(50,1) densityplot(~x+y)
2008 Aug 26
1
no output when run densityplot...
Hi, I have downloaded a R script from http://www.wessa.net/rwasp_edauni.wasp#output. This script produces a densityplot graphic, amongst others, when is executed from the web page. However, when I run it in my machine the *densityplot* function produces any output, I mean a blank graphic. But, it's interesting if I run the following lines in the R interactive console: > y <- as.ts(x$pending) > bit...
2004 Oct 19
3
densityplot and histogram
Is there any function like par(new=T) for lattice. I want to plot a histogram in percentages on the right hand side and also superimpose the densityplot with its density scale on the lhs. so far I am only able to do this histogram( temp[,2]~ temp[,1],nint=100,type="desnity", xlab = "Population Size", panel = function(x, ...) { panel.histogram(x, ...) panel.den...
2008 Mar 10
2
Multiple density plots
...6221 12.35381 r5 4.640885 8.635518 8.344704 11.98484 r6 4.559852 6.416171 10.419599 10.89247 r7 4.058033 7.378469 9.043280 11.88214 r8 3.439271 5.108395 10.197870 10.65987 r9 5.129664 4.326907 8.851552 11.46618 r10 4.258742 7.002541 8.716967 13.07019 I have been reading about the simple.densityplot However, I can't find it in R has it been replaced? >simple.densityplot(line6.1,line6.2,line7.1,line7.2, data = DF) Error: could not find function "simple.densityplot" > sessionInfo() R version 2.6.0 (2007-10-03) i386-apple-darwin8.10.1 locale: en_US.UTF-8/en_US.UTF-8/en_U...
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.70035...
2008 Feb 01
1
problem getting multiple densityplots on one page
Hi, I used the following statements to generate unsuccessfully a 5 by 5 multiple densityplots on a single page. If I use plot, the whole thing works. > data <- matrix(rnorm(25), 5, 5) > op <- par(mfrow = c(5, 5)) > for (x in 1:5) {densityplot(data[,x])} > par(op) Thanks Stanley [[alternative HTML version deleted]]
2010 Feb 16
0
Analyzing event times with densityplot
...02.02.2010 09:00:06 02.02.2010 09:00:06 02.02.2010 09:00:09 02.02.2010 09:00:11 02.02.2010 09:00:11 02.02.2010 09:00:11 etc, for several thousand rows. I'd like to get an idea how the web hits are distributed over time, over the week etc. I extract the data to a dataframe and I tried plotting densityplots: library(lattice) data <- as.POSIXct(scan("data.txt", what=character(0), sep="\n"), format="%d.%m.%Y %T") data.lt <- as.POSIXlt(data) data.df <- data.frame(time=data, se...