Re: [R] multiple rugs on a single plot

2007-07-17 Thread Albert Vilella
in a similar fashion, would it be possible to have the rug points on the density line itself instead of on the x-axis? thanks in advance, Albert. On 7/17/07, Dimitris Rizopoulos [EMAIL PROTECTED] wrote: you could use different colours, e.g., x1 - rnorm(100, -2.5, 1) x2 - rnorm(100, 0,

Re: [R] legend in lattice densityplot

2007-02-14 Thread Albert Vilella
(1,1,1,1,2 dev.off() On 11/30/06, Albert Vilella [EMAIL PROTECTED] wrote: Should it be a problem to print this dashed line plots as svgs? library(RSvgDevice) devSVG(file = /home/avilella/file01.svg, width = 20, height = 16, bg = white, fg = black, onefile=TRUE

Re: [R] legend in lattice densityplot [Broadcast]

2007-02-14 Thread Albert Vilella
, bottom, left and right. Hope this helps, Matt Wiener -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Albert Vilella Sent: Wednesday, February 14, 2007 8:46 AM To: R-help@stat.math.ethz.ch Subject: Re: [R] legend in lattice densityplot [Broadcast

[R] densityplot png in a for loop

2007-02-09 Thread Albert Vilella
Hi all, I am trying to plot a list of densityplots as png files, but when I do it in a for loop, I get empty png files as a result. If I manually run the instructions inside the loop, it works... any hints? library(lattice) names_list = c(alfa,beta,gamma) for (i in 1:length(names_list)) {

Re: [R] legend in lattice densityplot

2006-11-30 Thread Albert Vilella
Can I combine colors and line types? For example, would it be possible to have 5 colors per 2 types of lines (continuous and dashed)? On 11/29/06, Chuck Cleland [EMAIL PROTECTED] wrote: Albert Vilella wrote: Are this legend colors correlated to the plot? They are if you rely on the colors

Re: [R] legend in lattice densityplot

2006-11-30 Thread Albert Vilella
)), f = sample(c(A,B,C,D,E),300,replace=TRUE)) library(lattice) densityplot(~ x, DF, groups = f, auto.key = TRUE, plot.points = FALSE, par.settings = list(superpose.line = list(col = c(1,1,2,2), lty = 1:2, lwd = c(1,1,1,1,2 On 11/30/06, Albert Vilella [EMAIL PROTECTED] wrote: Can

[R] legend in lattice densityplot

2006-11-29 Thread Albert Vilella
Hi, I have a densityplot like this: x = c(rnorm(100,1,2),rnorm(100,2,4),rnorm(100,3,6)) f = sample(c(A,B,C,D,E),300,replace=TRUE) df=data.frame(x,f) library(lattice) attach(df) densityplot(~x, groups=f) And I want to add a legend with the colours for the factors. How can I do that? How can I

Re: [R] legend in lattice densityplot

2006-11-29 Thread Albert Vilella
Are this legend colors correlated to the plot? If I do a: densityplot(~x, groups=f, plot.points=FALSE, auto.key=TRUE,col=heat.colors(5)) I get different colors in the legend than the plot... On 11/29/06, Chuck Cleland [EMAIL PROTECTED] wrote: Albert Vilella wrote: Hi, I have

[R] multiple bi-connected venn diagrams

2006-11-17 Thread Albert Vilella
Hi all, I am looking for a way to display venn diagrams of a handful of vector, so that they are connected to the previous and the next. Something like: a-b-c-d-e-f-g where a and b are connected, b is also connected to c, etc. Any pointers? Thanks,

Re: [R] ape -- internal nodes and pie charts

2006-10-18 Thread Albert Vilella
)) So, all in all, Ape is great :) Albert. On 10/18/06, Jim Lemon [EMAIL PROTECTED] wrote: Albert Vilella wrote: Hi, I've been investigating the ape package for a while, and I was wondering if it is possible to: - display the names of the internal nodes (from a newick tree

[R] sort matrix by sum of columns

2006-06-21 Thread Albert Vilella
Hi all, I would like to know how can I sort the cols of a matrix by the sum of their elements. a - matrix(as.integer(rnorm(25,4,2)),10,5) colnames(a) = c(alfa,bravo,charlie,delta,echo) I guess I should use colSums, and then rearrange the matrix somehow according to the result. My idea is to

[R] write.table decimal digits

2006-06-20 Thread Albert Vilella
Hi all, I have a table with values that I rounded with: mytable = round(mytable, digits=2) and when I use write.table: write.table(mytable, file = /home/user/mytable.txt, sep = , row.names=TRUE, col.names=TRUE, quote=FALSE) the values are printed like 1 instead of 1.00 (which would make the

Re: [R] bubbleplot for matrix

2006-06-15 Thread Albert Vilella
,]) } symbols(as.numeric(x),as.numeric(y),z,inches=0.2,bg=khaki) text(as.numeric(x),as.numeric(y),labels=z) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Albert Vilella Sent: Tuesday, June 13, 2006 7:11 AM To: r-help@stat.math.ethz.ch Subject

[R] bubbleplot for matrix

2006-06-13 Thread Albert Vilella
Hi all, I would like to ask if it is possible to use bubbleplot for a 20x20 matrix, instead of a dataframe with factors in columns. The idea would be to get a tabular representation with bubbles like in Rnews_2006_2 article, which look very nice. Thanks in advance, Albert.

[R] sorting matrix elements by given rownames and colnames

2006-06-13 Thread Albert Vilella
Hi all, I would like to know if it is possible to sort the columns and rows in a matrix given a specified order of their colnames and rownames. For example: I would like the original matrix: RNO FRU ANG CEL DAR PTR RNO 3.45 1.35 2.16 2.25 1.43 1.20 FRU 1.31 Inf 2.22 2.36 1.34

[R] barplot dataframes w/ varying dimensions

2006-06-09 Thread Albert Vilella
Hi all, I would like to do a barplot of a dataframe like this one: alfa beta gamma delta qwert 56.5 58.5 56.5 58.5 asdfg 73.0 73.0 43.0 73.0 zxcvb 63.0 63.0 43.0 63.0 yuiop 63.0 63.0 43.0 63.0 with the labels of the rows and columns. I would like to have something

[R] histogram breaks as labels

2006-05-08 Thread Albert Vilella
Hi all, I would like to know if there is a way to have the diplay the breaks of the hist (as myhist$breaks here in the example) as the labels, instead of the myhist$counts: input = rpois(1000,5) myhist = hist(input, breaks = 15, labels=TRUE, axes=FALSE) So that, instead of having: 94 140 187

Re: [R] histogram breaks as labels

2006-05-08 Thread Albert Vilella
of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Albert Vilella

[R] entries that match a regexp

2006-04-28 Thread Albert Vilella
Hi all, I am trying to filter the element of a df that start with TF, like this: alfa = c(123221,TF13124,41243,TF1234,32414,TF13124,TF14333,2134123,TF1234) beta = c(type_a,type_b,type_a,type_g,type_d,type_a,type_g,type_a,type_g) mydf = data.frame(alfa,beta) mydf tf = mydf[mydf$alfa %in% TF,]

[R] labels inside the bars of horizontal barplot

2006-02-17 Thread Albert Vilella
Dears, I would like to add labels inside the bars of a horizontal bar plot like this: mylabels = c( long text goes here first, long text goes here second, long text goes here third, long text goes here fourth, long text goes here fourth, long text goes here fifth, long text goes

Re: [R] list entries file into a list

2006-01-27 Thread Albert Vilella
From: Albert Vilella Hi all, I have a file of this kind: entry0001:AB0032,CF32134,DF34334 entry0002:AB0033 entry0003:AB0032,CF32134,DF34334,DD343434,DD34222 entry0004:AB0032,CF32134 And I would like to read it into something like a hash, so that I can then loop over

[R] list entries file into a list

2006-01-26 Thread Albert Vilella
Hi all, I have a file of this kind: entry0001:AB0032,CF32134,DF34334 entry0002:AB0033 entry0003:AB0032,CF32134,DF34334,DD343434,DD34222 entry0004:AB0032,CF32134 And I would like to read it into something like a hash, so that I can then loop over it by keys and values. I wonder which would be

[R] ess emacs 'shift+-' and '-'

2005-12-30 Thread Albert Vilella
Hi all, I would like to ask about how to disable the ess emacs shortcut that converts shift+- to '-' instead of _ symbols. Thanks in advance, Bests, Albert. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] add factor to dataframe given ranges

2005-12-22 Thread Albert Vilella
Hi all, I would like to factorize the entries in a dataframe given some groupings. E.g: mydf = data.frame( a = rnorm(100,10), b = rnorm(100,10), c = rgamma(100, 1, scale=1)) group = hist(mydf$c, breaks=FD) group$breaks The idea is to create a factor mydf$d with levels corresponding to

[R] Ranking factors given a weight

2005-12-20 Thread Albert Vilella
Hi all, I'm trying to rank a couple of factors by a variable and a weight of the variable in each occurrence (some samples are bigger than others). input = data.frame( alfa = rnorm(5000), weight = rnorm(5000,-5,10), tag1 = sample(c(a,b,c,d),5000,replace=TRUE), tag2 =

[R] Ranking factors given a weight

2005-12-19 Thread Albert Vilella
Hi all, I'm trying to rank a couple of factors by a variable and a weight of the variable in each occurrence (some samples are bigger than others). input = data.frame( alfa = rnorm(5000), weight = rnorm(5000,-5,10), tag1 = sample(c(a,b,c,d),5000,replace=TRUE), tag2 =

Re: [R] memory tops out at 1.84gb on OS X 10.4 machine w/ 5GB ram

2005-12-15 Thread Albert Vilella
El dj 15 de 12 del 2005 a les 08:17 -0500, en/na Roger D. Peng va escriure: I'm not completely sure, but I don't think OS X is at the point yet where it can access 2GB of memory (like, for example, Linux on Opteron). More specifically, I'm not sure a single process image can access 2GB

[R] superimpose density line over hist

2005-12-13 Thread Albert Vilella
Hi all, I'm trying to superimpose a rchisq density line over a histogram with something like: hist(alnlength) lines(density(rchisq(length(alnlength), 4)),col=red) But the rchisq line won't appear anywhere, Anyone knows what I am missing here? Thanks in advance, Albert.

Re: [R] superimpose density line over hist

2005-12-13 Thread Albert Vilella
This certainly did the trick, Thanks Ted, Sean, Romain, Dimitris, Lian and Andy, alnlength-rchisq(1000,4) x-0.25*(0:100) hist(alnlength,breaks=0.25*(0:100)) lines(x,1000*dchisq(x,4)*0.25) And apologies for my newbieness in the posting, Albert.