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

2010-04-08 Thread Esmail
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

[R] Comparing matrices

2010-03-11 Thread Esmail
iciency. I am appending 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/(

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 o

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

2010-02-24 Thread esmail
one has a alternate solution, please let me know. In the meantime 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.

[R] sprintf + integer(0) problem

2010-02-24 Thread Esmail
loping and testing my code under 2.9 and 2.10 but then transferring it to a faster system 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 ge

Re: [R] lint for R? and debugging

2010-02-16 Thread Esmail
On 16-Feb-10 09:03, Karl Ove Hufthammer wrote: On Tue, 16 Feb 2010 08:00:09 -0500 Esmail wrote: And along the same lines, any type of interactive debugging utility for R? See this article in R News: 'Debugging Without (Too Many) Tears' http://cran.r-project.org/doc/Rnews/Rnews_

[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.

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

2010-02-15 Thread Esmail
his) Is there a faster 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/po

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 solve

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

2010-02-15 Thread Esmail
erent from 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 a

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

2010-02-15 Thread Esmail
ome reason 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("

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] 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

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

2010-01-10 Thread Esmail
bout my setup, I tried to be complete but I am happy to provide more information if it would 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 packag

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 r

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, reprodu

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 wickham wrote: In my view, that's the purpose of indenting - you see scope from indenting. *cough* python *cough* :-) (my favorite language at the moment) __ R-help@r-project.org m

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 _

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 ca

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. On

[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 of

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 http://www.R-proj

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

2009-05-25 Thread Esmail
s hoping this would provide a way for me to verify the workings 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/listinf

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

2009-05-25 Thread Esmail
plot and re-run various functions 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 pos

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

2009-05-24 Thread Esmail
tion over x and y given their respective intervals. 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 http

Re: [R] optimizing function over x,y

2009-05-23 Thread Esmail
ough right now I have run into problems 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 PLEAS

[R] using optimize() correctly ...

2009-05-23 Thread Esmail
to MINIMIZE > result=optimize(f, c(-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 ver

[R] optimizing function over x,y

2009-05-23 Thread Esmail
s R optimizes 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 anyon

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

2009-05-03 Thread Esmail
's forte 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, min

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 - t

Re: [R] comparing matrices

2009-04-26 Thread Esmail
David Winsemius wrote: > identical( matrix((1:4), ncol=2), matrix((1:4), nrow=2)) [1] TRUE > identical( matrix((1:4), ncol=2), matrix((2:5), nrow=2)) [1] FALSE Thanks David, much appreciated. Esmail __ R-help@r-project.org mailing list

Re: [R] comparing matrices

2009-04-26 Thread Esmail
tiste Hi 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/

[R] comparing matrices

2009-04-26 Thread Esmail
y, 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/mailm

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

2009-04-26 Thread Esmail
st shallow? Ie 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

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

2009-04-26 Thread Esmail
Right you are .. I discovered 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 __

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

2009-04-26 Thread Esmail
ALSE [3,] TRUE TRUE TRUE TRUE TRUE [4,] TRUE TRUE TRUE TRUE TRUE [5,] TRUE TRUE TRUE TRUE TRUE [6,] TRUE TRUE TRUE TRUE TRUE Thanks for the help, much appreciated. Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

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 pop=cre

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

2009-04-26 Thread Esmail
sent. So for the example given above, the comparison should return True. For instance, in Python this would be simply if sorted(keep_pop) == sorted(pop): print 'they are equal' else print 'they are not equal' Is there an equivalent R code seg

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

2009-04-25 Thread Esmail
print 'they are equal' else print 'they are not equal' Is there an equivalent R code segment? Thanks, Esmail --- the code called above - # create a binary ve

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 - t

Re: [R] flip certain bits in vector

2009-04-19 Thread Esmail
converts logical 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.or

[R] flip certain bits in vector

2009-04-19 Thread Esmail
ld 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 <=

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 PLEA

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

2009-02-20 Thread Esmail Bonakdarian
a powerful language 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" "

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

2009-02-20 Thread Esmail Bonakdarian
to the new 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-p

Re: [R] Python and R

2009-02-19 Thread Esmail Bonakdarian
ing 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 ma

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
Gabor Grothendieck wrote: On Wed, Feb 18, 2009 at 7:27 AM, Esmail Bonakdarian 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 is the main "bottl

Re: [R] Python and R

2009-02-18 Thread Esmail Bonakdarian
eciate all the helpful posts here. 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

Re: [R] Python and R

2009-02-18 Thread Esmail Bonakdarian
ctures. I 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 an

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! Than

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

2009-02-17 Thread Esmail Bonakdarian
how efficient 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

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

2009-02-17 Thread Esmail Bonakdarian
pt 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()) # create a bi

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
On Tue, Feb 17, 2009 at 6:05 PM, Barry Rowlingson wrote: > 2009/2/17 Esmail Bonakdarian : > 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) wow .

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Hello! On Tue, Feb 17, 2009 at 5:58 PM, Warren Young 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

[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 t

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] 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

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

2008-06-24 Thread Esmail Bonakdarian
g run be hidden from the user, or would the user be able to view/download/save the R source code - or could it be hidden so they just run the code, but never see it? Esmail __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

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
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 6

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 l

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 do

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

2008-06-11 Thread Esmail Bonakdarian
med rather 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 wa

Re: [R] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
) Thanks Jim. 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] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
match } Thanks! More R for me to sink my teeth 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 http

Re: [R] searching for specific row in matrix

2008-06-11 Thread Esmail Bonakdarian
t) { rows = 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 p

[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,]11

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("

Re: [R] Improving data processing efficiency

2008-06-06 Thread Esmail Bonakdarian
ckages("profr") Warning 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 __

Re: [R] R + Linux

2008-06-06 Thread Esmail Bonakdarian
way. 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 PLEA

Re: [R] R + Linux

2008-06-06 Thread Esmail Bonakdarian
a Linux system 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/

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] Thank you

2008-05-29 Thread Esmail Bonakdarian
their knowledge 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 to make R running faster

2008-05-28 Thread Esmail Bonakdarian
Erin Hodgess wrote: I remember reading the colSum and colMean were better, when you need sums and means Well .. I'm waiting for the experts to jump in and give us the straight story on this :-) __ R-help@r-project.org mailing list https://stat.ethz.

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.htm

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] 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 that

Re: [R] Printing output in STDOUT

2008-05-20 Thread Esmail Bonakdarian
nd until someone who 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 comm

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

2008-05-20 Thread Esmail Bonakdarian
rather than 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

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] 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] test

2008-05-13 Thread Esmail Bonakdarian
er 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/lis

Re: [R] Format integer

2008-05-13 Thread Esmail Bonakdarian
t; cat(sprintf("%05d\n", i)) 00013 > 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, reproducible code.

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

2008-05-12 Thread Esmail Bonakdarian
http://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-cont

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

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 ___

Re: [R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
see examples. 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.

Re: [R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
the documentation, it's 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

[R] which.max2()

2008-05-09 Thread Esmail Bonakdarian
sult=c(m, 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, minim

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

2008-05-06 Thread Esmail Bonakdarian
,"^2", sep="")) 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 __

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

[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 have

Re: [R] efficiency & profiling?

2008-04-30 Thread esmail bonakdarian
, I have been reading the list, 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 ___

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

2008-04-30 Thread esmail bonakdarian
y useful for newbies 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

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

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. Agree

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.

[R] representing binary data for Genetic Algorithm in R

2008-04-20 Thread esmail bonakdarian
estions (I am reading the various manuals too .. 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