[R] subsetting of a data.frame

2009-05-21 Thread culpritNr1
Hello everybody How do you subset a data.frame when your boundaries are a combination of explicit and implicit limits? For example, I need to subset from the fourth (explicit) to the last (implicit) column a data.frame named A. In other languages you would do A[ , 4:]. Would anybody show me

Re: [R] subsetting of a data.frame

2009-05-21 Thread culpritNr1
Hi Sarah and Jorge, ncol(). How elegant! Thank you. Jorge Ivan Velez wrote: Dear culprit Try this: A[ , 4:ncol(A) ] HTH, Jorge On Thu, May 21, 2009 at 12:06 PM, culpritNr1 ig2ar-s...@yahoo.co.uk wrote: Hello everybody How do you subset a data.frame when your

Re: [R] File permissions

2009-03-10 Thread culpritNr1
information but how do I SET those permissions? Well, file.info is better are displaying permission information, and Sys.chmod set them in the format used by file.info. Thank you Your culpritNr1 -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics

Re: [R] a general question

2009-03-10 Thread culpritNr1
, Ghia Euskirchen2, Raymond K Auerbach3, Zhengdong D Zhang1, Theodore Gibson1, Robert Bjornson4, Nicholas Carriero4, Michael Snyder1,2 Mark B Gerstein1,3,4. Nature Biotechnology, 2009. Take a look at it and let us know what you think. Your culpritNr1 PS: next time, please go for a more descriptive

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread culpritNr1
OH! The joy! It worked like a sharm. Thank you. culpritNr1 baptiste auguie-2 wrote: try ?paste baptiste On 10 Mar 2009, at 20:01, ig2ar-s...@yahoo.co.uk wrote: Hi again R-ists, How do you construct a string that you can pass to system()? For instance. Say I do

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread culpritNr1
I meant charm, not sharm! (how embarrasing...) culpritNr1 wrote: OH! The joy! It worked like a sharm. Thank you. culpritNr1 baptiste auguie-2 wrote: try ?paste baptiste On 10 Mar 2009, at 20:01, ig2ar-s...@yahoo.co.uk wrote: Hi again R-ists, How do

Re: [R] system() not accepting strings from cat()

2009-03-10 Thread culpritNr1
embarrasSing, not embarrasing. You see how I became culpritNr1? culpritNr1 wrote: I meant charm, not sharm! (how embarrasing...) culpritNr1 wrote: OH! The joy! It worked like a sharm. Thank you. culpritNr1 baptiste auguie-2 wrote: try ?paste

Re: [R] Calling R functions from Python

2009-01-09 Thread culpritNr1
get your windows to work as well. To start with, I suggest that you upgrade to R 2.8.0. By now R 2.8.1 is the official version for Fedora (linux) users. So, we can consider 2.7 rather old. Best, culpritNr1 ryan-147 wrote: All- Thanks in advance for your help. I'm

[R] Drawing from an empirical distribution

2009-01-06 Thread culpritNr1
Hi All, Does anybody know if there is a simple way to draw numbers from an empirical distribution? I know that I can plot the empirical cumulative distribution function this easy: plot(ecdf(x)) Now I want to pick a number between 0 and 1 and go back to domain of x. Sounds simple to me. Any

Re: [R] Drawing from an empirical distribution

2009-01-06 Thread culpritNr1
Thank you. That's exactly what I was looking for. Antonio, Fabio Di Narzo wrote: If the ecdf is 'ecdf(x)', do just: sample(x, size=whatever, replace=TRUE) HTH, Antonio. 2009/1/6 culpritNr1 ig2ar-s...@yahoo.co.uk: Hi All, Does anybody know if there is a simple way to draw numbers

[R] Paddding an integer with zeros

2008-10-21 Thread culpritNr1
Hello List, Can anybody point me to a number-to-string formatting function? I need to convert, say, 12 to 00012. I tried format() but its too stubborn: it seems to only pad with spaces. Thank you, Your culpritNr1 -- View this message in context: http://www.nabble.com/Paddding-an-integer

Re: [R] Paddding an integer with zeros

2008-10-21 Thread culpritNr1
sprintf works like a charm. I feel rather embarrassed right now. I see that when I do ?format, at the very end of the documentation, sprintf is suggested as further reading. muito obrigado culpritNr1 Henrique Dallazuanna wrote: Try this: formatC(12, width = 5, flag = 0) or sprintf

Re: [R] Inserting a new row in a matrix

2008-10-21 Thread culpritNr1
me wrong! Your culpritNr1 Alex99 wrote: Hi guys, I need to insert a row to a matrix in a for loop. I have matrix named Avg which is a 5x4 matrix of zeros. I have a file named A(4 rows,14 columns) which I make a sample of it 5 times. each time I get the mean for each column and put

Re: [R] R: in-place appending to a matrix.

2008-10-16 Thread culpritNr1
and mouse.) So, do you know whether or not such functions exists or is planned to be incorporated in the near future? An optional module perhaps? Again, thank you, culpritNr1 Gabor Grothendieck wrote: Create an empty matrix first and then fill it in. That will avoid the overhead

[R] R: in-place appending to a matrix.

2008-10-15 Thread culpritNr1
in 1:1000) { if (some condition) { newRow - myFunction(myArguments) append(X, newRow) } } You see? I do not have to call and re-assign the giant X matrix every loop cycle. Any help? Thank you, Your culpritNr1 -- View this message in context: http://www.nabble.com/R%3A