[R] representing binary data for Genetic Algorithm in R

Thibaut Jombart jombart at biomserv.univ-lyon1.fr
Sun Apr 20 18:23:49 CEST 2008

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.

>Hello all,
>I am trying to implement a simple Genetic Algorithm. I am doing this
>in R since I want access to the statistical functions (eg lm) it
>I'm not new to programming, or GAs, but I am totally new to R (the
>package and the language), and I am hoping someone could help with
>these questions:
>1. I am going to use a binary representation, it seems that vectors of
>   Factors would be what I should use? I would specify values of
>   TRUE/FALSE instead? Or is there a better choice for manipulating
>   binary strings? Does this seem like a legitimate way to create a
>   random one: sample(0:1, vec_size, replace=T)
Factors are nice to manipulate binary strings (they use integers as 
internal representation).

>2. Am I correct in assuming that R is interpreted (and hence is going to
>   be noticeably slower than compiled languages)?
Yep. But you can have R call C and Fortran code as well.

>3. Is there some sort of debugging facility?

>4. Does anyone know how to do an effective search for R in google (or
>   other search engines). The fact that this is a single letters seems
>   to have most applications ignore this input. This might help me in
>   finding answers to some other basic questions I have (such as is
>   there an equivalent function to "printf" in R? "cat" and "print"
>   are not quite working right for me -- but I need to dig deeper into
>   the documentation)
Functions: ?, help.search, apropos, RSiteSearch. See also 

>I am not sure if this belongs into the help or development 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.
Instructions and posting guide are there:

>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)
>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.
See the rJava package.



CNRS UMR 5558 - Laboratoire de Biométrie et Biologie Evolutive
Universite Lyon 1
43 bd du 11 novembre 1918
69622 Villeurbanne Cedex
Tél. :
Fax :
jombart at biomserv.univ-lyon1.fr

More information about the R-help mailing list