Displaying 20 results from an estimated 38 matches for "esmail".
Did you mean:
email
2009 Aug 28
6
Google's R Style Guide
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 the main languages
used by Google.
2009 Apr 19
3
flip certain bits in vector
...in pseudo code this would 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
2008 Jun 12
3
Adding new columns to (output) data - e.g., read 5 cols write 8
...nd data).
It seems that there ought to be a simple way to do this, could
someone provide some guidance on the best way to accomplish
this task? (I tried a few things as this seemed 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 way to learn something
new.
2008 May 09
2
which.max2()
...e for the
maximum value. If I want the two index values for the two
largest values, is this a decent solution, or is there a
nicer/better R'ish way?
max2 <-function(v)
{
m=which.max(v)
v[m] = -v[m]
m2=which.max(v)
result=c(m, m2)
result
}
Seems to work ok.
Thanks,
Esmail
2009 Apr 26
4
comparing matrices
...FALSE.
This is the hack (rather ugly I think) I put together that works,
but there has to be a nicer way, 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
2008 May 07
1
Automatically generating new column names (and columns)
...name=get(paste(names(simpleData)[i],"^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
2010 Feb 24
2
sprintf + integer(0) problem
...a crash - but
that didn't work.
I am developing 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 generated when the string isn't found
2001 Jan 14
2
Help
Dear sir,
I am using R in windows. I want to extend R Memory
size.
I use the following command, but unfortunately it
doesn't work.
-- vsize=15M --nsize=1000K
Your help is appreciated.
Thanks,
Esmail Amiri.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/...
2009 Apr 27
3
Formatting numbers
...n for Longitudinal Data"
> (Tirthankar Chakravarty)
> 11. Re: THE EQUIVALENT OF SQL INNER TABLE JOIN IN R
> (Gabor Grothendieck)
> 12. Re: THE EQUIVALENT OF SQL INNER TABLE JOIN IN R (Peter Dalgaard)
> 13. Re: 3 questions regarding matrix copy/shuffle/compares (Esmail)
> 14. Re: Conditional plot labels (baptiste auguie)
> 15. Re: Scatterplot of two groups side-by-side? (baptiste auguie)
> 16. Help to select the raw in a data.frame with the max value
> (Alessandro)
> 17. re moving entries from one vector that are in another (onyourmar...
2010 Feb 15
1
argh .. if/else .. why?
...?
The format of the if/else #3 below is ok, but if/else #1 is not? (I get
an "unexpected else" type error.) In order for it to work I have to use
if/else #2
Thanks .. maybe there is some 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("lme for %d runs - timeR\n", RUNS))
if (ZELIG){ ####### if/els...
2009 Feb 18
2
how to randomly eliminate half the entries in a vector?
...ok
slick and I wonder 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
------
rm(list=ls())
####################################################
# create a binary vector of size "len"
#
create_bin_Chromosome <- function(len)
{
sample(0:1, len, replace=T)
}
####################################################
# HUX - half uniform crossover
#
# 1. det...
2009 May 23
1
optimizing function over x,y
...st a neat and easy way as 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 anyone written any programs in Python that they then have used
to call R functions? I am thinking of writing some of my scripts in
Python, but then accessing some of R's functions.
2008 May 06
2
building a formula string bit by bit ..
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 a one, I want to include the
corresponding entry in the vars vector, otherwise ignore it. Of
2008 Jun 11
3
searching for specific row in matrix
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,] 1 0 1 1 0
[2,] 1 1 0 1 0
[3,] 0 0 1 0 0
[4,] 1 0 0 1 1
[5,]
2010 Mar 11
2
Comparing matrices
...50 rows and this
comparison will happen very frequently (possibly a few thousand
times), so I am concerned about efficiency.
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/(deep)copy of the
data? I tried a few tests that seem to confirm this, but I'd
rather be sure.
------- code ------------
# create a binary vector of size "len"
create...
2009 Apr 26
3
3 questions regarding matrix copy/shuffle/compares
...ifferent it should not matter as long as
the same rows are present. Again, 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 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)
}
############## create_population ###################
# creat...
2010 Apr 08
1
formatting a result table (number of digits)
...n for the Value,
Std.Error. (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 the table I am trying to format:
> load('data.rda')
> library(nlme)
> ic <- lme(Ind_Cntrbn ~
D_Clb_Pbl+D_Club+Round+Ind_cntr_1+GR_cntr_1+D_Success_1+IndEarngs_1+D_Unfair_cntr_1+D_1st10rnds+D_Female+D_econ_gov+D_mjr_social+D_frshmn+D_ju...
2008 Apr 20
1
representing binary data for Genetic Algorithm in R
...nt group, so
I'm giving this a try. If this is the wrong group to post in, please
let me know and I'll repost.
There will probably be more elementary questions (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 has any comments regarding that please share.
_________________________________________________________________
Going green? See the top 12 foods to eat organic.
1N1653A
[[a...
2008 May 27
1
hash or other quick lookup function?
...r is there an alternative approach that would do the same in R?
The lookup should be quick, otherwise the gains from avoiding
recomputing identical values would be lost to some extent.
I wasn't able to find anything via searches, I am hoping someone can
point me in the right direction.
Thanks
Esmail
2009 May 24
1
using optimize() correctly ...
...tive
[1] 247.3284
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 version 2.8.1 (2008-12-22) under Ubuntu 9.04