[R] clustersets comparison

2011-03-07 Thread Albert Vilella
Hi, I have produced some clustersets with the same program and different parameters and want to compare them. They contain a few thousand clusters each with a few million elements in total. After googling around, I couldn't find much of relevance, so I am asking here. Is there any package in R

[R] hide ends of line in a density plot

2010-07-06 Thread Albert Vilella
Hi, (I googled for this answer but didn't find anything) I am using density plot and I want to trim the ends of the line. eg: i = rnorm(100,100,2) j = subset(i,i102 i98) summary(j) plot(density(j)) I only want the line to go from 98 to 102. How can I limit the line (and the axis) to the

[R] left-to-right series of box and whisker plots from a csv file

2010-04-24 Thread Albert Vilella
Hi, I've got a csv file with scores like this: 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,32,38,40,20,40,26,40,30,40,5,5,13,12,40,40,3,33,29,23,2,24,9,15,4,21,16,5,26,8,8,18

[R] processing all files with certain extension in a directory

2010-01-15 Thread Albert Vilella
Hi all, I'm trying to process all files with a certain extension *.ext in a directory like this: R --slave --args /my/dir dir_plot.r where I then I want to do something like: myarg - commandArgs() inputdir - myarg[length(myarg)] print(inputdir) for file with extension *.ext in inputdir do

[R] rmysql fetch issues

2009-04-21 Thread Albert Vilella
I am trying to fetch data using RMySQL fetch method with n=100 in this loop: lquery = paste(query, limit 10) input = dbGetQuery(con1,lquery) res = dbSendQuery(con1,query) completed = FALSE count = 0 while (completed != TRUE) { count = count + 1 batch = fetch(res, n = 100) print

Re: [R] matching subvectors in vector sets

2009-04-18 Thread Albert Vilella
:A00096:A02178:A02178:A07776 1 1 A00096:A00096:A00096:A00096:A02178:A02178:A07776 1 On Fri, Apr 17, 2009 at 9:33 AM, Albert Vilella avile...@gmail.com wrote: Starting by the first entry

[R] matching subvectors in vector sets

2009-04-17 Thread Albert Vilella
Hi, I've got a list of ~2 elements that look like this: [1] A00096:A00096:A00096:A00096:A02178:A02178:A07776 [2] A00046:A00076:A01101:A04146:A05671:A07169 [3] A00038:A00932:A02185:A02370:A02818:A02818:A02818:A02818:A04732:A07142:A07142 [4] A00096:A01352:A01352:A02023:A05001:A05001:A07776

Re: [R] matching subvectors in vector sets

2009-04-17 Thread Albert Vilella
the output that you would expect from the data you gave. I am not sure what you mean by a 'subvector'. On Fri, Apr 17, 2009 at 5:25 AM, Albert Vilella avile...@gmail.com wrote: Hi, I've got a list of ~2 elements that look like this: [1] A00096:A00096:A00096:A00096:A02178:A02178

[R] how to use substring match as condition?

2008-05-29 Thread Albert Vilella
Hi, How can I use a substring match as a condition in a subset command? Sth like this: subset(input, field1==blah1 field2==blah2) # but now with substring match in field2 subset(input, field1==blah1 field3 *substringmatch* blah3) I've tried with gsub, but it won't work: subset(input,

[R] calculate sd for each row on some columns of a dataframe

2008-02-28 Thread Albert Vilella
Hi, I've got a dataframe like this: df = data.frame(a=rnorm(100,1),b=rnorm(100,10),c=rnorm(100,100),d=rnorm(100,-100)) and I want to calculate sd1 for (a,b,c) for each entry, and sd2 for (b,c,d) for each entry. I don't seem to find the answer using aggregate or apply, How can I do this?