[R] formatting a result table (number of digits)

2010-04-08 Thread Esmail
. (And if it would be easy to get rid of scientific notation, that would be good to know too). So ideally keep the table/headers etc, but chance the entries. I've looked at format and print without much success. I'm using R 2.10.1 in a Linux environment. Thanks, Esmail Below's an example of generating

[R] Comparing matrices

2010-03-11 Thread Esmail
the code I used to generate my matrices and some things I tried (mentioned above) and also the output get so far. FWIW, Linux environment, R 2.10.1. Thanks, Esmail ps: Am I correct that if I do the assignment pop2 = pop I create a totally separate instance/(deep)copy of the data? I tried

[R] sprintf + integer(0) problem

2010-02-24 Thread Esmail
that unfortunately still uses 2.8.0 .. I'd rather not have to keep modifying the source each time I upload it. I'm hoping someone has an easy fix. Thanks Esmail PS: in v 2.10.1 no output at all is generated when the string isn't found __ R-help@r

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread esmail
I'm going to try to use this code to determine if I should display the info or not: min = version[[minor]] maj = version[[major]] ver = paste(maj, '.',min, sep='') if (ver == 2.8.0) ... Cheers, Esmail -- View this message in context: http://n4.nabble.com/sprintf-integer-0-problem

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread Esmail
On 24-Feb-10 20:03, Henrique Dallazuanna wrote: You can use tryCatch also: cat(tryCatch(sprintf('found %s in col %d\n', s, c), error = function(x)cat('Not Found\n'))) Ah .. one more way .. thanks, I've saved it away in my set of R tricks! Best, Esmail

[R] lint for R? and debugging

2010-02-16 Thread Esmail
versions 2.9-2.10 Thanks, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] lint for R? and debugging

2010-02-16 Thread Esmail
/Rnews_2003-3.pdf#page=29 Thanks for the pointer, that looks very interesting. Any lint-like utilities out there? I miss a lot of the development tools I have available for Python or Java with R, esp once the code starts to grow beyond a few hundred lines. Esmail

[R] argh .. if/else .. why?

2010-02-15 Thread Esmail
for this, but this looks very inconsistent to me. R version 2.10.1 (2009-12-14) Ubuntu 9.04 Esmail --- #if (ZELIG) if/else #1 # cat(sprintf(Zelig for %d runs - timeR\n, RUNS)) #else # cat(sprintf(lme for %d runs - timeR\n, RUNS

Re: [R] argh .. if/else .. why?

2010-02-15 Thread Esmail
other languages I have worked with, but the explanation is clear. Thanks you! Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] argh .. if/else .. why?

2010-02-15 Thread Esmail
On 15-Feb-10 09:27, lee.ad...@luminant.com wrote: I, personally, utilize the ifelse(test,statement,statement) function when possible over the methodology outlined. Haven't used that construct before, I'll check it out. Thanks. And mystery solved. Esmail

[R] a fast way to get AIC, BIC and logLik?

2010-02-15 Thread Esmail
way yet to get the AIC/BIC/logLik values? (I hope this question makes sense) Thanks, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

[R] lme4 and function 'cholmod_start' not provided by package 'Matrix' / Ubuntu

2010-01-10 Thread Esmail
help. Thanks! Esmail Ubuntu 9.04 Linux t61 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 18:57:07 UTC 2009 i686 GNU/Linux library(lme4) Loading required package: Matrix Loading required package: lattice Attaching package: 'Matrix' The following object(s) are masked from

Re: [R] lme4 and function 'cholmod_start' not provided by package 'Matrix' / Ubuntu

2010-01-10 Thread Esmail
On 10-Jan-10 12:12, Dieter Menne wrote: Esmail Bonakdarian-4 wrote: Using Ubuntu 9.04 and R 2.8.1. For a project I need to use the Zelig package, which in turn wants to use the lme4 package. When trying to use Zelig and it tries to its required packages I get the following error message

Re: [R] lme4 and function 'cholmod_start' not provided by package 'Matrix' / Ubuntu

2010-01-10 Thread Esmail
your suggestion and upgraded R to 2.10.1 and I had to install lme4 and zelig from source to get the current packages. Thanks again! Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Learning R

2009-11-30 Thread Esmail
level step by step. Regards Julia I heard some time back that O'Reilly is coming out with a book on R .. not sure if that's out yet, or how good it might be. Worth looking into ... Esmail ps: Just checked, 'R in a Nutshell': http://oreilly.com/catalog/9780596801717 release date dec 2009

Re: [R] Google's R Style Guide

2009-08-30 Thread Esmail
, I'll check it out. Cheers, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
Duncan Murdoch wrote: On 8/28/2009 8:59 AM, Esmail wrote: Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? The rules are mostly reasonable, though they aren't the ones followed in the R source. One bad

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
(Ted Harding) wrote: On 28-Aug-09 12:59:24, Esmail wrote: Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? I think it is grossly over-prescriptive. For example: function names have initial capital

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
Kingsford Jones wrote: A few thoughts: ... -- It's nice that people have made these guides available Agreed .. it helps those relatively new to the language (and possible other language biases) get their orientation. Cheers, Esmail __ R-help

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
Barry Rowlingson wrote: On Fri, Aug 28, 2009 at 5:11 PM, hadley wickhamh.wick...@gmail.com wrote: In my view, that's the purpose of indenting - you see scope from indenting. *cough* python *cough* :-) (my favorite language at the moment) __

Re: [R] Best R text editors?

2009-08-28 Thread Esmail
Jonathan Greenberg wrote: Quick informal poll: what is everyone's favorite text editor for working with R? Emacs+ESS __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Google's R Style Guide

2009-08-28 Thread Esmail
Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? Thanks, Esmail ps: Reminds me of PEP 8 for Python http://www.python.org/dev/peps/pep-0008/ Maybe not that surprising since Python is also one

Re: [R] using optimize() correctly ...

2009-05-25 Thread Esmail
repeatedly over various ranges or starting points. Thanks again for the help/information, much appreciated. Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] using optimize() correctly ...

2009-05-25 Thread Esmail
of a genetic algorithm I am testing. I appreciate you taking the time to explain this so clearly, thanks again, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

Re: [R] using optimize() correctly ...

2009-05-24 Thread Esmail
. Will they also potentially only give me the local maxima/minima? I am not a regular R user, so my knowledge is clearly not where is could/should be. Thanks, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] optimizing function over x,y

2009-05-23 Thread Esmail
a 1-D function? For this particular instance I am interested in the minimum of x * sin(4*x) + 1.1 * sin(2*y), where x,y in range 0-10 so an example of this in R would be great, though in other problems the range may not be identical for x and y. Thanks, Esmail ps: Has anyone written any

[R] using optimize() correctly ...

2009-05-23 Thread Esmail
(-10,10), lower = -10, upper=10, maximum=FALSE) result $minimum [1] 6.290112 $objective [1] 91.52681 However, I believe the correct values should be minimize: x = -5.838 val= -133.020 maximize: x = -8.957 val= 438.448 Thanks, Esmail This is w/ R version 2.8.1 (2008-12-22) under Ubuntu

Re: [R] optimizing function over x,y

2009-05-23 Thread Esmail
with even the simple (?) optimize function, so I'll first have to figure out what I'm doing wrong with it. Best, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] running R on netbooks/minis?

2009-05-03 Thread Esmail
is not speed, but frugal power consumption. HTH, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] 3 questions regarding matrix copy/shuffle/compares

2009-04-26 Thread Esmail
' Is there an equivalent R code segment? I hope this post is clearer than my original one. Thank you David for pointing out some of the shortcomings of my earlier post. Thanks, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] 3 questions regarding matrix copy/shuffle/compares

2009-04-26 Thread Esmail
David Winsemius wrote: Yes. As I said before I am going to refrain from posting speculation until you provide valid R code that will create an object that can be the subject of operations. The code I have provided works, here is a run that may prove helpful: POP_SIZE = 6 LEN = 8

Re: [R] 3 questions regarding matrix copy/shuffle/compares

2009-04-26 Thread Esmail
,] TRUE TRUE TRUE TRUE TRUE Thanks for the help, much appreciated. Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

Re: [R] 3 questions regarding matrix copy/shuffle/compares

2009-04-26 Thread Esmail
this now too. It's really confusing to go back and forth between different languages. I have been programming in Python for the last 2 months and everything there is a reference .. so I have to worry about deep copy etc. Thanks! Esmail __ R-help@r

Re: [R] 3 questions regarding matrix copy/shuffle/compares

2009-04-26 Thread Esmail
if I change something in 'pop' would it be reflected in 'keep_pop' too? (I don't think so, but just wanted to check). I would like two independent copies. Regardless, the net outcome was new knowledge, so this is a good outcome. Esmail __ R

[R] comparing matrices

2009-04-26 Thread Esmail
, no? res=pop[1:ROWS,] == keep[1:ROWS,] if ((ROWS*COL) == sum(res)) { cat('they are equal\n') }else cat('they are NOT equal\n') Thanks! Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] comparing matrices

2009-04-26 Thread Esmail
Babtiste, Thanks for pointing out the various options that exist. R is a very rich language indeed and it's good to know how to accomplish tasks in various ways. Cheers, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] comparing matrices

2009-04-26 Thread Esmail
ONKELINX, Thierry wrote: Have a look at all.equal matA - matrix(1:4, ncol = 2) matB - matA all.equal(matA, matB) matB[1,1] - -10 all.equal(matA, matB) Hi Thierry, Thanks, all.equal does indicate if it's all equal so that works great! Much nicer than my hack - thanks, Esmail

[R] 3 questions regarding matrix copy/shuffle/compares

2009-04-25 Thread Esmail
' Is there an equivalent R code segment? Thanks, Esmail --- the code called above - # create a binary vector of size len # create_bin_Chromosome - function(len) { sample(0:1, len, replace=T

[R] flip certain bits in vector

2009-04-19 Thread Esmail
be something like --- r = c() for (i in 1:10) if (i in p) r = c(r, flip[i]) r doesn't work :-) R doesn't like the if statement. Is there a nice, concise way to do this? The vector contents and size will vary, but length of p = b. Thanks, Esmail

Re: [R] flip certain bits in vector

2009-04-19 Thread Esmail
TRUE/FALSE to 0/1 r [1] 0 0 0 0 0 0 0 0 1 0 Great! .. thanks ... I appreciate the hlep, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] flip certain bits in vector

2009-04-19 Thread Esmail
jim holtman wrote: try this: b - c(1, 0, 1, 0, 1, 0, 1, 0, 1, 0) p - c(1, 3, 5, 7) b[p] - ifelse(b[p] == 0, 1, 0) I'll have to look up the ifelse operator, looks like the ternary operator used in C b[p] = b[p]==0?1:0 Cool - thanks! Esmail __ R

Re: [R] difference between assignment syntax - vs =

2009-02-21 Thread Esmail Bonakdarian
Patrick Burns wrote: 'The R Inferno' page 78 is one source you can look at. Patrick Burns wow .. nice! .. thanks for posting this reference. Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Sorting rows in a matrix based on vector of indecies

2009-02-20 Thread Esmail Bonakdarian
matrix. Do I have to worry about deallocating the memory space of the first matrix or will it automagically go away if I assign the new matrix to the old matrix identifier (assuming nothing else is pointing at it)? Thanks, Esmail __ R-help@r-project.org

Re: [R] Sorting rows in a matrix based on vector of indecies

2009-02-20 Thread Esmail Bonakdarian
as I am starting to discover (and folks on the list here are very helpful). Regards, Esmail David Winsemius wrote: See if this helps: mtx-matrix( rep(letters[1:4], 6), nrow=4) mtx [,1] [,2] [,3] [,4] [,5] [,6] [1,] a a a a a a [2,] b b b b b b [3,] c c c c c c [4,] d d d

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
Doran, Harold wrote: lm(y ~ x-1) solve(crossprod(x), t(x))%*%y# probably this can be done more efficiently You could do crossprod(x,y) instead of t(x))%*%y that certainly looks more readable (and less error prone) to an R newbie like myself :-)

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
on the programming aspects of R. Problem is that I suspect my colleagues who are providing some guidance with the stats end are not quite experts themselves, and certainly new to R. Cheers, Esmail Kenn Konstabel wrote: lm does lots of computations, some of which you may never need. If speed really matters, you

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
Gabor Grothendieck wrote: On Wed, Feb 18, 2009 at 7:27 AM, Esmail Bonakdarian esmail...@gmail.com wrote: Gabor Grothendieck wrote: See ?Rprof for profiling your R code. If lm is the culprit, rewriting your lm calls using lm.fit might help. Yes, based on my informal benchmarking, lm

Re: [R] Python and R

2009-02-18 Thread Esmail Bonakdarian
am not familiar with lm.fit, I'll definitely look it up. I hope it's similar enough to make it easy to substitute one for the other. Thanks for the suggestion, much appreciated. (My runs now take sometimes several hours, it would be great to cut that time down by any amount :-) Esmail

[R] Python and R

2009-02-17 Thread Esmail Bonakdarian
with Python to be able to access R's functionality. Is there much of a performance hit either way? (as both are interpreted languages) Thanks, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Hello! On Tue, Feb 17, 2009 at 5:58 PM, Warren Young war...@etr-usa.com wrote: Esmail Bonakdarian wrote: I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? No, but if I

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
On Tue, Feb 17, 2009 at 6:05 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: 2009/2/17 Esmail Bonakdarian esmail...@gmail.com: When I need to use the two together, it's easiest with 'rpy'. This lets you call R functions from python, so you can do: from rpy import r r.hist(z

[R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Esmail Bonakdarian
for #3, or for that matter anything that looks odd. Below my partial solution .. the HUX function is what I am trying to finish if someone can point me in the right direction. Thanks Esmail -- rm(list=ls()) # create a binary vector of size

[R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Esmail Bonakdarian
it is. Mostly I need help for #2, but will happily accept suggestions for #3, or for that matter anything that looks odd. Below my partial solution .. the HUX function is what I am trying to finish if someone can point me in the right direction. Thanks Esmail -- rm(list=ls

Re: [R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Esmail Bonakdarian
Gene Leynes wrote: This is my first help post, hope it works! Just check out the sample function At the command line type: ?sample I think it will be pretty clear from the documentation. Yes, most excellent suggestion and quite helpful! Thanks, Esmail

Re: [R] running R-code outside of R

2008-06-25 Thread Esmail Bonakdarian
Jim Porzak wrote: The user of your R script sees only the outputs you create. The R source is hidden. Ah .. that sounds great .. I wish I had known about this a month ago! I'll have to check it out - thanks! Esmail HTH, Jim Porzak .. Would the R script that is being run be hidden from

Re: [R] running R-code outside of R

2008-06-25 Thread Esmail Bonakdarian
Spencer Graves wrote: If you want to hide the fact that you are using R -- especially if you charge people for your software that uses R clandestinely -- that's a violation of the license (GPL). No on both accounts .. but thanks for pointing this out none the less.

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Esmail Bonakdarian
hadley wickham wrote: 2008/6/20 [EMAIL PROTECTED] [EMAIL PROTECTED]: If you do nothing to your code, in 18 months time its performance will have doubled because computers will have become faster. Your code will not get easier to understand by itself. Very nicely put .. and true too!

Re: [R] replace column headers

2008-06-17 Thread Esmail Bonakdarian
on how to read your new column names from a file into a vector but if you can get them into that format this should let you accomplish your goal. Esmail load(Data/simpleTestData2.rda) df Y X1 X2 X3 X4 X5 X6 1 74.9 10 49.8 0.2 99 50 57 2 79.8 11 49.6 0.4 69 91 57 3 84.4 12

[R] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
Hi, I have matrix of bits and a target vector. Is there an efficient way to search the rows of the matrix for the target? I am interested in the first row index where target is found. Example: source(lookup.R) [,1] [,2] [,3] [,4] [,5] [1,]10110 [2,]110

Re: [R] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
= length(pop[1,]) for(i in 1:rows) { result = (pop[i,] == target) if (sum(which(result==FALSE)) == 0) return(i) } return (-1) } idx=searchPop(pop, target) if (idx 0) { cat(NOT found\n) } else cat(Found at position , idx, \n) Esmail

Re: [R] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
in :-) My own solution doesn't seem to work quite correctly as I found out from some further testing .. so the solutions posted here are much appreciated! Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
# determine which data matches matches - t(pop) == target # 't' due to matching in column order # colSums equal to COLS will indicate matches which(colSums(matches) == COLS) Neat! .. somewhat similar to the solution I came up with in the meantime, only yours works :-) Thanks Jim. Esmail

[R] Adding new columns to (output) data - e.g., read 5 cols write 8

2008-06-11 Thread Esmail Bonakdarian
trivial, but did not succeed. I still hope/assume this is a trivial thing to do if one knows R well) Thanks, Esmail ps: I want to thank everyone again who posted their solutions to my previous query. Seeing different solutions for the same problem is a tremendously effective way to learn

Re: [R] Adding new columns to (output) data - e.g., read 5 cols write 8

2008-06-11 Thread Esmail Bonakdarian
Hi Erik, Erik Iverson wrote: Esmail - Are these 5 vectors of data stored in a data.frame? I assume so. Yes, I do a simple load() call first to read the .rda file ... test2 - transform(test, d = 2*a + b, e = 3*c) save(test2, file = test2.Rdata) Does this help? Yes it does

Re: [R] Adding new columns to (output) data - e.g., read 5 cols write 8

2008-06-11 Thread Esmail Bonakdarian
jim holtman wrote: yourDF - cbind(yourDF, f=yourDF$a+yourDF$b, g=yourDF$a * 3, h=yourDF$c + yourDF$d) Thanks Jim, I also learned about the transform() method from Erik which will also work beautifully. Esmail __ R-help@r-project.org mailing list

Re: [R] R + Linux

2008-06-06 Thread Esmail Bonakdarian
rather than tinker with it, you could do much worse than Ubuntu. I installed R via the package manger a month ago or so, very easy and trouble free. Hope that helps, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] R + Linux

2008-06-06 Thread Esmail Bonakdarian
. Are you curious about Linux and Ubuntu? Trying them out has never been easier! For more information see: http://wubi-installer.org/ Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Improving data processing efficiency

2008-06-06 Thread Esmail Bonakdarian
message: package ‘profr’ is not available any ideas? Thanks, Esmail library(profr) p - profr(fcn_create_nonissuing_match_by_quarterssinceissue(...)) plot(p) That should at least help you see where the slow bits are. Hadley __ R-help@r-project.org

Re: [R] Improving data processing efficiency

2008-06-06 Thread Esmail Bonakdarian
Esmail Bonakdarian wrote: hadley wickham wrote: Hi, I tried this suggestion as I am curious about bottlenecks in my own R code ... Why not try profiling? The profr package provides an alternative display that I find more helpful than the default tools: install.packages(profr

Re: [R] Thank you

2008-05-29 Thread Esmail Bonakdarian
too! Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] How do you exit a function in R?

2008-05-29 Thread Esmail Bonakdarian
Bill Cunliffe wrote: For example, based on a certain condition, I may want to exit my code early: # Are there the same number of assets in prices and positions? if (nAssetPositions != nAssetPrices) { cat(Different number of assets! \n\n)

Re: [R] hash or other quick lookup function?

2008-05-28 Thread Esmail Bonakdarian
Hi Duncan, Duncan Murdoch wrote: Duncan Murdoch wrote: Esmail Bonakdarian wrote: Hello all, I have a matrix of bit values. I compute certain values based on the bits in each row. There may be *duplicate* entries in the matrix, ie several rows may be identical. These rows change over time

Re: [R] How to make R running faster

2008-05-28 Thread Esmail Bonakdarian
? The reason for apply was that it was more concise but not necessarily more efficient. Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

[R] recompute values repeatedly, or new file for glm()?

2008-05-20 Thread Esmail Bonakdarian
the 4 I show above. I hope this made some sense. Thanks, Esmail ps: If it makes sense to preprocess X1,X2,X3 and X4 to generate a new file that contains the values for X1, X2, X3, X4, I(X1^2), I(X2^2), I(X3^2), I(X4^2), X1*X2, X1*X3, X1*X4 ,X2*X3, X2*X4, X3*X4 is there an easy way

Re: [R] Printing output in STDOUT

2008-05-20 Thread Esmail Bonakdarian
knows more about R can come up with an answer. HTH Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] Printing output in STDOUT

2008-05-20 Thread Esmail Bonakdarian
Prof Brian Ripley wrote: On Tue, 20 May 2008, Esmail Bonakdarian wrote: Edward Wijaya wrote: Hi, Currently the R script I have is executed with this command: $ R CMD BATCH mycode.R And the output is stored in mycode.Rout. Is there a way I can issue command from shell (like above) so

Re: [R] Format integer

2008-05-13 Thread Esmail Bonakdarian
, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] test

2008-05-13 Thread Esmail Bonakdarian
if it has to do with the fact that both of us use gmail to post to the list? In any case, regardless if we see them, they are getting posted, which is what matters :) Cheers, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] test

2008-05-13 Thread Esmail Bonakdarian
Charilaos Skiadas wrote: On May 13, 2008, at 5:52 AM, Esmail Bonakdarian wrote: Tony Plate wrote: You probably should check this section in your R-help subscription options (via https://stat.ethz.ch/mailman/options/r-help/, I think): Receive your own posts to the list? Tony, Like jt I

Re: [R] Random number generation

2008-05-13 Thread Esmail Bonakdarian
Greg Snow wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Esmail Bonakdarian Sent: Sunday, May 11, 2008 7:25 AM To: Prof Brian Ripley Cc: [EMAIL PROTECTED] Subject: Re: [R] Random number generation [snip] What I read doesn't seem

Re: [R] [OT] xemacs on windows vista

2008-05-12 Thread Esmail Bonakdarian
://vgoulet.act.ulaval.ca/en/ressources/emacs/ HTH, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] Random number generation

2008-05-11 Thread Esmail Bonakdarian
* comments with scripts? A la /* ... */ like it's done in Java or C/C++? Ie comment more than just one line at a time. From what I have read this is not possible in R (at least not easily), but I am eager for someone to contradict me :-) Thanks, Esmail __ R

Re: [R] Random number generation

2008-05-11 Thread Esmail Bonakdarian
Hello there, Prof Brian Ripley wrote: On Sun, 11 May 2008, Esmail Bonakdarian wrote: Stephan Kolassa wrote: Have you tried successively removing/commenting parts of the script before the sample() command until the problem goes away? That way you should be able to pinpoint the offending

[R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
, m2) result } Seems to work ok. Thanks, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
probably there, but not that clear to me. Thanks for showing me something more R'ish. Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
. Best, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] building a formula string bit by bit ..

2008-05-06 Thread Esmail Bonakdarian
Hello, Still a newbie with R, though I have learned a lot from reading this list. I'm hoping someone can help with this question: I have two vectors, one for variables, and one for bits. I want to build a string (really a formula) based on the values in my vector of 1s and 0s in bits. If I

Re: [R] building a formula string bit by bit ..

2008-05-06 Thread Esmail Bonakdarian
Jorge Ivan Velez wrote: Hi Esmail, Try this: vars=c('X.1', 'X.2', 'X.3', 'X.4', 'X.5') bits=c(1, 0, 1, 1, 0) paste(vars[which(bits==1)],collapse=+) HTH, Jorge Wow .. that is beautiful :-) .. and exactly what I was looking for (and suspected existed). I ended up doing this: eqn=(paste

[R] Automatically generating new column names (and columns)

2008-05-06 Thread Esmail Bonakdarian
=)) simpleData- transform(simpleData, name=(simpleData[,i]^2)) } print(simpleData) Any suggestions/hints .. I've searched the FAQ and web (this is how I came across the get() function) but no luck so far. Thanks, Esmail __ R-help@r-project.org mailing list

[R] efficiency profiling? (was: Why R is 200 times slower than Matlab ?)

2008-04-30 Thread esmail bonakdarian
like me. Thanks all, Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

Re: [R] efficiency profiling?

2008-04-30 Thread esmail bonakdarian
, the amount of messages per day is simply amazing, I can hardly keep up. Do most of you read this on the web or get it as digest? I am getting them as individual e-mails (thank god for filters) ... :-) Esmail _ Back to work after baby–how do

Re: [R] Documentation General Comments

2008-04-21 Thread esmail bonakdarian
I realize the R developers are probably overwhelmed and have little time for this, but the documentation really needs some serious reorganizaton. A good through description of basic variable types would help a lot, e.g. the difference between lists, arrays, matrices and frames. Agreed,

Re: [R] Documentation General Comments

2008-04-21 Thread esmail bonakdarian
Thank you Rob, I just downloaded it and it looks very useful. In the meantime I think I solved my immediate problem (and while pluggin' away also deepened my understanding - or so I will at least claim :-) Esmail I don't know if you will find this helpful, but one of the better online

[R] representing binary data for Genetic Algorithm in R

2008-04-20 Thread esmail bonakdarian
.. but if anyone has some other favorite sites they want to recommend please do so) Thanks, Esmail ps: I there a USENET group dedicated to R? pps: I am also exploring ways of calling R functions from Java, if anyone has any comments regarding that please share

Re: [R] representing binary data for Genetic Algorithm in R

2008-04-20 Thread esmail bonakdarian
Hello! Dear Esmail, you really have to have a look at some introduction to R (e.g. http://cran.r-project.org/doc/manuals/R-intro.pdf), but see the Manual section in R website (http://www.r-project.org/). That would answer many of your questions. point well taken, I am a bit