[R] [R-pkgs] Rcpp11 3.1.0 is on CRAN.

2014-04-12 Thread Romain Francois
Hello, R version 3.1.0 was released yesterday, and as always is welcome with great pleasure. One of the features that is of particular interest to me is the support for C++11. I would encourage you to read [Writing R Extensions](http://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-

Re: [R] simple payoff function

2010-12-11 Thread Romain Francois
e help page as max. > pmax(x-10, 0) [1] 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 > ?pmax Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/fT2rZM : highlight 0.2-5 |- http://bit.ly/gpCSpH : Evolution of Rc

Re: [R] Strange problems with compiling dll

2010-12-02 Thread Romain Francois
gure out where I should use them. I'm trying from here C:\Rtools\src\gnuwin32 but each time i get make: *** No rule to make target `R.exp'. Stop. So where should I state this rule and which rule?... Will you help me, please, to "connect" my C compiler to R? Best rega

Re: [R] Error using Rcpp under windows xp

2010-12-02 Thread Romain Francois
ed reference to 'RcppResultSet::RcppResultSet()' ... undefined reference to 'double* Rcpp::internal::r_vector_start<14,double>(SEXPREC*)' collect2: ld returned 1 exit status Can someone help me out? Thanks, -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 3

Re: [R] help: program efficiency

2010-11-27 Thread Romain Francois
ple.interval [1] 0.02 $sampling.time [1] 7.22 The 4.16 % taken by file.exists indicates that someone in the inline project has to do some work (on my TODO list). But otherwise sort.list dominates the time. Romain Le 26/11/10 21:22, Romain Francois a écrit : Le 26/11/10 21:13, Romain Fra

Re: [R] help: program efficiency

2010-11-26 Thread Romain Francois
Le 26/11/10 21:13, Romain Francois a écrit : Hello, Can we really make the assumption that the data is sorted. The original example was not: I am working on a function to make a duplicated value unique. For example, the original vector would be like : a = c(2,1,1,3,3,3,4) If we can make

Re: [R] help: program efficiency

2010-11-26 Thread Romain Francois
ttps://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-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

Re: [R] Is there an implementation for "URL Encoding" (/format) in R?

2010-11-25 Thread Romain Francois
haps ?URLencode -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9VOd3l : ZAT! 2010 |- http://bit.ly/c6DzuX : Impressionnism with R `- http://bit.ly/czHPM7 : Rcpp Google tech talk on youtube

Re: [R] [Rcpp-devel] fast rowCumsums wanted for calculating the cdf

2010-10-15 Thread Romain Francois
s another message in this thread I am replying to this message to be able to include the whole discussion to this point. Gregor mentioned the possibility of extending the compiled code for cumsum so that it would handle the matrix case. The work by Dirk Eddelbuettel and Romain Francois on developing t

Re: [R] RJava help

2010-10-14 Thread Romain Francois
ect class. Why is this? It would be useful if you showed your Test java class and repost on the appropriate mailing list for rJava: http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfran

Re: [R] How to convert SEXP to double

2010-09-28 Thread Romain Francois
template operator T() { return ::Rcpp::as(x); } private: Rcpp::RObject x; }; Please register to the Rcpp-devel mailing list of you have follow up questions. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://r

Re: [R] get absolute file path

2010-09-26 Thread Romain Francois
Le 26/09/10 12:18, Kurt Hornik a écrit : Sebastian Gibb writes: Am Sonntag, 26. September 2010, 10:08:39 schrieb Romain Francois: Le 26/09/10 10:00, Sebastian Gibb a écrit : Hello, I get a value which stores a relative file name. (I get it from another function, which I don't wa

Re: [R] get absolute file path

2010-09-26 Thread Romain Francois
g. /home/sebastian/documents/data/2010-08.csv) Kind regards, Sebastian Hi, I often use tools:::file_path_as_absolute which is not exported from the tools namespace, but does the job. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.f

Re: [R] characters in a string

2010-09-15 Thread Romain Francois
ion( x ) grepl( "^.*$", x ) > f( "a,b,c,d" ) [1] TRUE See ?grepl for details. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/cCmbgg : Rcpp 0.8.6 |- http://bit.ly/bzoWrs : Rcpp svn revision 2

Re: [R] faster unlist,strsplit,gsub,for

2010-09-10 Thread Romain Francois
wrote: Hi, I perform the operations unlist,strsplit,gsub and the for loop on a lot of strings and its heavily slowing down the overall system. Is there some way for me to speeden up these operations..maybe like alternate versions that exist which use multiprocessors etc.

Re: [R] R and Java

2010-08-20 Thread Romain Francois
9 Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-2 _

Re: [R] Rserve (Anyone?)

2010-08-20 Thread Romain Francois
hat you can do is close the device (calling dev.off()), and then send the file accross the wire. Rserve has some methods for file transfer. For example, see : http://romainfrancois.blog.free.fr/index.php?post/2009/08/04/Transfer-files-through-Rserve Romain -- Romain Francois Professional R En

Re: [R] Random Number Generators and Sample

2010-08-16 Thread Romain Francois
SEXP rho) You'll have all the details there. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bzoWrs : Rcpp svn revision 2000 |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th `- http://bit.ly/aAyra4 : highlight 0.2-

Re: [R] incrementing matrix elements more efficiently

2010-08-15 Thread Romain Francois
function( i){ cbind( i, which( mx[i] == mx ) ) } ) ) sparseMatrix( matchIndex[,1], matchIndex[,2] ) } which gives some improvement : > system.time( h( x = long ) ) user system elapsed 0.048 0.000 0.048 Romain -- Romain Francois Professional R Enthusiast +

Re: [R] cacheSweave / pgfSweave driver for package vignette

2010-08-14 Thread Romain Francois
if I can do something in highlight to make this easier than it currently is. Romain Sincerely, baptiste On 13 August 2010 11:10, Romain Francois wrote: Hi, I've been meaning to ask the same question before. Le 13/08/10 11:01, baptiste auguie a écrit : Dear list, I wish to use

Re: [R] Creating list from a long vector

2010-08-14 Thread Romain Francois
Le 14/08/10 18:22, steven mosher a écrit : Stupid question, but its been a long night. If I have a long vector how can I turn it into a list of the same length x<-rep(seq(1,100,by=1),each=10) Perhaps as.list ? -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 h

Re: [R] cacheSweave / pgfSweave driver for package vignette

2010-08-13 Thread Romain Francois
way to control which sweave (and perhaps tangle) driver is to be used for a particular vignette would be very useful. Romain I have no experience in writing makefiles, so I'm hoping someone would already have solved this issue and could provide some advice. Sincerely, baptiste -- Romai

Re: [R] Identifying integers (as opposed to real #s) in matrix

2010-08-10 Thread Romain Francois
x == round(x) ) == ncol(x) [1] TRUE FALSE TRUE FALSE > x[ rowSums( x == round(x) ) == ncol(x) , ] <- NA > x [,1] [,2] [,3] [1,] NA NA NA [2,] 1.2 2.2 3.2 [3,] NA NA NA [4,] 1.2 1.2 1.3 Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30

Re: [R] How to extract the conf.level out of t.test() data

2010-08-10 Thread Romain Francois
x$conf.int what gives [1] 496.9141 499.6276 attr(,"conf.level") [1] 0.95 In the example I try to extract the value 0.95 but I have no Idea how. I hope somebody can help me. Thanks in advance an greetings from Berlin Etienne You need the conf.level attribute, as in : x <- t.test(1:10

Re: [R] Sciviews-K -- object 'httpdPort' not found

2010-08-05 Thread Romain Francois
getBuiltinRhome.GString() [1] "/usr/lib/R" Does anybody know how to resolve this? Thanks in advance! Cheers!! Albert-Jan -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/aAyra4 : highlight 0.2-2 |- ht

Re: [R] bonjour

2010-07-30 Thread Romain Francois
reproducible code. mais à part ça, bienvenue ! Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/94EBKx : inline 0.3.6 |- http://bit.ly/aryfrk : useR! 2010 `- http://bit.ly/bc8jNi : Rcpp 0.8.4

Re: [R] How get colnames and rownames in Rcpp method?

2010-07-28 Thread Romain Francois
0dllmain%2Ewwl737%2Ehanmail%2Enet%3E] References 1. mailto:dllm...@hanmail.net -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/aryfrk : useR! 2010 |- http://bit.ly/bc8jNi : Rcpp 0.8.4 `- http://bit.ly/dz0RlX : bibt

Re: [R] O/T good c/c++ code for LU decomposition

2010-07-26 Thread Romain Francois
lo" ) fx( matrix( runif(100), 10, 10) ) Romain Le 26/07/10 23:46, Erin Hodgess a écrit : Dear R People: Could someone recommend a good c/c++ code (or Fortran) for LU decomposition, please? Sorry to bother about this. I'm trying to do some "non-R" work that requires a matr

Re: [R] problem with building package on CRAN

2010-07-26 Thread Romain Francois
pkg/lib/2.11/Rcpp/include I do have several suggested packages (polycor, GPArotation, MASS, graph, Rgraphviz, mvtnorm, Rcsdp), but none of these are actually required. My examples all ask if the suggested packages are available and then do not call them if they are not. Any suggestions on what

Re: [R] How to generate PDF help file for our internal R package?

2010-07-16 Thread Romain Francois
Thanks! From the directory that contains your package : $ R CMD Rd2dvi yourpackage Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/bc8jNi : Rcpp 0.8.4 |- http://bit.ly/dz0RlX : bibtex 0.2-1 `- http://bit.ly/a5CK2h : Les

Re: [R] Fast string comparison

2010-07-13 Thread Romain Francois
if two strings (about 100-150 characters long) are equal? Ralf On Sun, Jul 11, 2010 at 2:37 PM, Sharpie wrote: Ralf B wrote: What is the fastest way to compare two strings in R? Ralf Which way is not fast enough? In other words, are you asking this question because profiling s

Re: [R] nested for loops

2010-07-05 Thread Romain Francois
){ for(d19 in 0:n){ for(d20 in 0:n){ list=c(d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,d18,d19,d20) Probably not what you want, but this should replicate the same effect as the code you posted: list <- rep( n, 20 ) Romain -- Romain Francois Professiona

Re: [R] Call by reference or suggest workaround

2010-06-19 Thread Romain Francois
> ( x <- genMultiIndices( 3L , 2L ) ) [,1] [,2] [,3] [1,]200 [2,]110 [3,]101 [4,]020 [5,]011 [6,]002 > ( y <- genMultiIndices_internal( 3L, 2L ) ) [,1] [,2] [,3] [1,]200 [2,]1

Re: [R] C interface

2010-06-18 Thread Romain Francois
was hoping that the __cdecl specifier would force the appropriate convention. I also have Cygwin installed as part of the Python(x,y) distribution but I am assuming that R CMD SHLIB source.c calls the right compiler. What could the problem be? Many thanks, Michael -- Romain Francois Prof

Re: [R] tempfile problem

2010-06-17 Thread Romain Francois
vely, create the tempfile() as well as the tempfile().png, but this is likely to be really slow if the seed is the same each time, because checking for the existence of the first n tries is going to be slow. Duncan Murdoch Would it not make sense to change the signature of tempfile to this: fu

Re: [R] How to take the lower triangular part from a full matrix

2010-06-16 Thread Romain Francois
the time to send a reproducible example on how you make you data, i.e: > x <- matrix( 1:9, nr = 3, byrow = T ) See ?lower.tri > x[ upper.tri(x) ] <- 0 Or see ?row and ?col > x[ row(x) < col(x) ] <- 0 Also note that ??triangular finds lower.tri Romain -- Romain Fr

Re: [R] RegExp question

2010-06-16 Thread Romain Francois
\d+)\\n.+$", "\\1", string) [1] "1" The parens within the search pattern are matched to "\\1". Need to double backslashed within patterns. Regards, Andrej -- David Winsemius, MD West Hartford, CT -- Romain Francois Professional R Enthusiast +33(0)

Re: [R] Error when callin g C-Code

2010-06-15 Thread Romain Francois
break; } } xNT[0] = xNT[0] + 1; } for(j;j< ltgrid;j++) { xNi[j] = xNT[0]; } } PutRNGstate(); UNPROTECT(6); return tau; } -- Romain Fra

Re: [R] minor tick marks

2010-06-09 Thread Romain Francois
/www.avignon.inra.fr/psh web INRA : http://www.inra.fr/ -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph gallery collage `- http://bit.ly/bZ7ltC : inline 0.3.5 ___

Re: [R] Highlighting Text in Console

2010-06-09 Thread Romain Francois
;ve searched the Web, the R manuals and the FAQ's but not found anything yet. Any help greatly appreciated. Thanks. -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph

Re: [R] R with Emacs

2010-06-04 Thread Romain Francois
Le 04/06/10 12:55, dhanush a écrit : I want to know how Emacs works with R. can anyone provide me a link or manual to read? Thank you http://lmgtfy.com/?q=R+emacs The first link is what you want. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http

Re: [R] sig for R and C++

2010-06-03 Thread Romain Francois
n/listinfo/ The Posting Guide also has a question: Which list: R-help, R-devel, or Bioconductor? with some guidance on this point. HTH, Marc Schwartz -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/c6YnCi : graph galle

Re: [R] using the name of an argument in a function

2010-05-25 Thread Romain Francois
;numeric", definition = function(y,...){ nameOfY<-deparse(substitute(y)) cat("name is ",nameOfY) } ) toto<- 4 fun(toto) # name is toto setMethod("fun","character", definition = function(y,x,...){ nameOfY<-deparse(substitute

Re: [R] make: Nothing to be done for `all'.

2010-05-11 Thread Romain Francois
works fine. But fort eh file hello.c #include void hello(int *n) { int i; for(i=0; i< *n; i++) { Rprintf("Hello, world!\n"); } } I try R CMD SHLIB hello.c and I ge tthe error make: Nothing to be done for `all'. Why does one compile and the other not? -- Romain Francois Pro

Re: [R] make: Nothing to be done for `all'.

2010-05-11 Thread Romain Francois
Le 11/05/10 13:40, Elizabeth Lawson a écrit : When I try $ rm hello.o hello.so I get the error -bash: $: command not found What does that mean? Did you actually type the '$' ? You should not have. -- Romain Francois Professional R Enthusiast +33(0) 6 28 91

Re: [R] make: Nothing to be done for `all'.

2010-05-10 Thread Romain Francois
have tried reinstalling Xcode and R but I am still having this problem. Any suggestions? You can try $ rm hello.o hello.so Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9aKDM9 : embed images in Rd documents |-

Re: [R] Error in RImageJ

2010-05-08 Thread Romain Francois
: java.lang.InternalError: Can't start the AWT because Java was started on the first thread. Make sure StartOnFirstThread is not specified in your application's Info.plist or on the command line starting httpd help server ... done Can someone help me figuring out what this

Re: [R] Split a vector by NA's - is there a better solution then a loop ?

2010-04-29 Thread Romain Francois
it won't matter } new.groups.split.id[is.na(x)]<- 0 return(split(x, new.groups.split.id)[-1]) } split.vec.by.NA(x) Thanks, Tal -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9aKDM9 : embed images in Rd documents

Re: [R] JRI API: sourcing from Java String

2010-04-28 Thread Romain Francois
ng assign, and then in R do something like : eval( parse( text = FOO ) ) Questions about JRI, rJava, REngine, etc ... usually belong to the stats-rosuda-devel mailing list: http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel Romain -- Romain Francois Professional R Enthus

Re: [R] Error message when trying to install Rcmdr

2010-04-17 Thread Romain Francois
/i486-pc-linux-gnu-library/2.10/00LOCK’ Any help at solving this problem would greatly be appreciated. -Michael -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9aKDM9 : embed images in Rd documents |- http://tr.im/OIXN : raster

Re: [R] Inline Package: void vs return type functions

2010-04-13 Thread Romain Francois
nB2: do you have a simple example of this? ?cfunction Writing R extensions Many thanks Sergio Barrios -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/9aKDM9 : embed images in Rd documents |- http://tr.im/OIXN : rast

Re: [R] I can´t run the example shown in the inline pa ckage

2010-04-09 Thread Romain Francois
LoadLibrary failure: No se puede encontrar el módulo especificado. .Call( "f" ) Error in .Call("f") : C symbol name "f" not in load table Sergio -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bi

Re: [R] Okay, here is what I am doing

2010-04-08 Thread Romain Francois
ble * x ); 16: } 17: 18: void quadfn ( int * n, double * x ) { 19: 20: squarefn(n, x); 21: squarefn(n, x); 22: 23: } Error in compileCode(f, code, language, verbose) : Compilation ERROR, function(s)/method(s) not created! Following the example shown in this PDF,,, after the fns&

Re: [R] Adding RcppFrame to RcppResultSet causes segmentation fault

2010-04-01 Thread Romain Francois
evels, 1); row1[3].setDateValue(RcppDate(7,4,2006)); frame.addRow(row1); // Second row. std::vector row2(numCol); row2[0].setStringValue("b"); row2[1].setDoubleValue(6.28); row2[2].setFactorValue(levelNames, numLevels, 1); row2[3].setDateValue(RcppDate(12,25,2006)); frame.addRow(row2); RcppR

Re: [R] Error using Rcpp

2010-03-25 Thread Romain Francois
h: No such file or directory /usr/local/include/Rcpp.h:35:23: error: RcppFrame.h: No such file or directory /usr/local/include/Rcpp.h:36:26: error: RcppFunction.h: No such file or directory /usr/local/include/Rcpp.h:37:22: error: RcppList.h: No such file or directory could someone help? im afrai

Re: [R] Embed R code in C++

2010-03-23 Thread Romain Francois
any of them, but thy will make the process easier. Could you tell me where can i get Rcpp pkg? cran, but google knows and would have given you the answer more quickly. How can i Install it because i dont know how to compile a source file on the terminal. Thanks very much for your help.

Re: [R] R script From PHP

2010-03-23 Thread Romain Francois
is is more of a PHP question. Thank you and Any help appreciated. S -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe : Rcpp 0.7.7 `- http://tr.im/O1wO : highlight

Re: [R] Embed R code in C++

2010-03-22 Thread Romain Francois
y IDE XCode. Could anyone help me step by step because I am new in programming to show me how to get this done? Thanks for your help. Mans. -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |-

Re: [R] Can't setup rJava under ubuntu

2010-03-19 Thread Romain Francois
or details. e a simple JNI program. See config.log for details. But I can't find any config.log file so I am unable to understand what is the error! Can the log be redirected to console? Any suggestion on how to find config.log? Any suggestion on having R working with java under Ubuntu?

Re: [R] Creating Rcpp RcppDatetime from string with millisecond

2010-03-19 Thread Romain Francois
n advance. Rob -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe : Rcpp 0.7.7 `- http://tr.im/O1wO : highlight 0.1-5 __ R-help@r-proj

Re: [R] C# DLL Library

2010-03-16 Thread Romain Francois
Le 17/03/10 04:42, Jeremie Smaga a écrit : I found the problem for the package that wasn't found... My R version was 2.9. Sorry about that. However, I would really appreciate it if you could let me know where I could find the mailing list... Thanks, Jeremie On Tue, Mar 16, 2010 at 6:56

Re: [R] C# DLL Library

2010-03-16 Thread Romain Francois
its. Otherwise, I could use a C++ DLL, but I don't know if it is really recommended. (In fact, I would love to be able to develop it in Visual Studio because it is where I developed the rest of my platform). So, what would you advise? Thanks, -- Jeremie Smaga -- Romain Francois Professional

Re: [R] how can I look at .Internal(model.matrix(t, data))?

2010-03-09 Thread Romain Francois
anks so much! Werner -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe : Rcpp 0.7.7 `- http://tr.im/O1wO : highlight 0.1-5 __

Re: [R] Writing own simulation function in C

2010-03-07 Thread Romain Francois
.603356 -6.632470 6.753585 -9.424831 8.758971 -4.430569 [8] 3.737836 -5.297374 -9.968060 Happy hacking! -Charlie - Charlie Sharpsteen Undergraduate-- Environmental Resources Engineering Humboldt State University -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 3

Re: [R] Running complete R script from Java

2010-03-05 Thread Romain Francois
3:51 AM, Ralf B wrote: Is it possible to run a R script from Java (via JRI (part of rJava): http://www.rforge.net/rJava/) without adding it line by line into a JRI java application? Ralf -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://

Re: [R] Double Colors in Main

2010-03-02 Thread Romain Francois
q(5), seq(5), main=paste(name_vec[1]," and ",name_vec[2], sep="")) dev.off() What I would like to achieve is rather simple to explain, but it is giving me a headache: how can I have two colors in main? Let us say that I would like 'color1' to be blue and 'color2&

Re: [R] colour highlighting inputs and outputs in the R terminal?

2010-02-24 Thread Romain Francois
e. If you prefer to not use or learn Emacs, there are other editors available such as Vim, Bluefish, Eclipse and many others available for Linux, some of which are listed here: http://www.sciviews.org/_rgui/projects/Editors.html JGR is also available for Linux: http://jgr.markushelbig.org/J

Re: [R] What is the difference between expression and quote whenused with eval()?

2010-02-21 Thread Romain Francois
On 02/21/2010 01:45 AM, blue sky wrote: On Sat, Feb 20, 2010 at 2:40 AM, Romain Francois wrote: On 02/19/2010 10:31 PM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of blue sky Sent: Friday, February 19

Re: [R] What is the difference between expression and quote whenused with eval()?

2010-02-20 Thread Romain Francois
Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 -- Romain Francois Profe

Re: [R] executable R script under xp (to avoid migration toward Matlab or C++)

2010-02-15 Thread Romain Francois
boss to keep R. But I'm not sure that I will be successful (there is a pressure to have a single language for all the scripts and even money for that ...). And for this year I have been registered to a matlab course ... But I will do my best to promote R !!! Thanks again, Pti

Re: [R] executable R script under xp (to avoid migration toward Matlab or C++)

2010-02-15 Thread Romain Francois
it is not the case but I hope I missed a way to do it. Thanks in advance for your answers, Have a nice day, Ptit Bleu. -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OcQe : Rcpp 0.7.7 |- http://tr.im/O1wO : highlight 0.1

Re: [R] How to repeat the names?

2010-02-10 Thread Romain Francois
.. I have tried the following commands rep(c(city1,city2), 5) and I got the output something like this [1] 1 1 1 1 1 1 ... If I try rep((city1,city2), 5) Error: unexpected ',' in "rep((city1," Please guide Regards MAdhavi -- Romain Fr

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Romain Francois
On 02/08/2010 04:16 PM, Hadley Wickham wrote: parser::nlines does it in C. Looks promising, but I need something that uses connections because I'm working with big bzipped files. Hadley Ah... the lack of c-level api for connections again ;-) -- Romain Francois Professional R Enthu

Re: [R] Fast way to determine number of lines in a file

2010-02-08 Thread Romain Francois
Hi, parser::nlines does it in C. Romain On 02/08/2010 03:16 PM, Hadley Wickham wrote: Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley -- Romain Francois Professional R Enthusiast

Re: [R] Number with fixed digit length - zero fill-up

2010-02-01 Thread Romain Francois
from the right hand side? Thank you. With kind regards, Jonas Jägermeyr Department of Geography Humboldt-University of Berlin jonas.jaegerm...@geo.hu-berlin.de -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7

Re: [R] Error with toString

2010-01-26 Thread Romain Francois
d "An Introduction to R" too, because R is nothing like vb. Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7.2 |- http://tr.im/JOlc : External pointers with Rcpp `- http://tr.im/JFqa : R Journal, Volum

Re: [R] reading a string vector

2010-01-26 Thread Romain Francois
I unconcatenate it, so I can use each of the letters on my reading? Thanks, Beatriz See ?strsplit > strsplit( x, "")[[1]] Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7.2 |- http://tr.i

Re: [R] Error with toString

2010-01-26 Thread Romain Francois
returns me this error: Error in toString(20) : could not find function ".jcall" what did I do wrong? I couldn't find this error anywhere... .jcall is in rJava, but rJava never calls toString. Can you attach a bit more information as requested by the posting guide : http://www.r-pro

Re: [R] Where can I get training for R-PLUS

2010-01-25 Thread Romain Francois
On 01/25/2010 03:02 PM, jamy wrote: Hi friends, Does any one know ,where can I get free training for R-PLUS.If any one know please let me know. Thanks, James. http://lmgtfy.com/?q=R-plus+training -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http

Re: [R] header files for R packages

2010-01-24 Thread Romain Francois
l you really need. Otherwise, you can lock the binding using lockBinding, but this is not full proof as one can still remove the variable and recreate it ... it just makes it harder to modify, but not impossible Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romai

Re: [R] matrix to a C function

2010-01-23 Thread Romain Francois
f(" %f",mTraj[i,j]); 6. } 7. Rprintf("\n"); 8. } 9. } It does not work, but is there an solution close to this ? Thanks. Christophe -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7.2 |

Re: [R] Optimizing C code

2010-01-22 Thread Romain Francois
y[i])) { 10. dev = (x[i] - y[i]); 11. if(!ISNAN(dev)) { 12. dist += dev * dev; 13. count++; 14. } 15. } 16. } 17. if(count == 0)return NA_REAL; 18. if(count != taille) dist /= ((double)count/taille); 19. return sqrt(dist); 20.} -- Romain Francois Professional R Enthusiast +

Re: [R] Working with text data/text operators

2010-01-19 Thread Romain Francois
","Bond2.Price", how do I select only the columns corresponding to Bond1? Thanks a lot, Mihai You can do things like : > dataset[ , grepl( "^Bond1", names( dataset ) ) ] > dataset[ , substr( names( dataset ), 1, 5 ) == "Bond1" ] Romain -- R

Re: [R] Error: object of type 'closure' is not subsettable

2010-01-18 Thread Romain Francois
. I can combine functions using "c" without any problems: c(example_function, example_function) [[1]] function () { return(TRUE) } [[2]] function () { return(TRUE) } What am I doing wrong when I use rep()? Thanks in advance, Matthew Walker -- Romain Francois Professional R Enthusiast

Re: [R] Better way than an ifelse statement?

2010-01-14 Thread Romain Francois
X1 X2 X3 1 1.75308880 1 -3 2 -0.49273616 2 -1 3 -0.12446648 3 1 4 -0.06417217 4 3 Thanks for your help, Joshua -- Joshua Wiley Senior in Psychology University of California, Riverside http://www.joshuawiley.com/ -- Romain Francois Professional R Enthusiast +33

Re: [R] Logical function

2010-01-14 Thread Romain Francois
: ds$n2<- nash(ds) I mean I would like to add a new variable "n2", whose value depends on the value of other variables - row per row. I played with a for loop (don't flame :p), with apply functions and derivatives, with a logical set, etc Can you help me find the "R&

Re: [R] question on 'within' and 'parse' commands

2010-01-07 Thread Romain Francois
ally like the 'eval' command? alternative: within.data.frame <- function (data, textCMD, ...) { parent <- parent.frame() e <- evalq(environment(), data, parent) eval(parse(text=textCMD), e) # used to be eval(substitute(expr), e) l <- as.list(e) l <- l[!sapply(l, is.null

Re: [R] issue with using rm: cannot generate on-the-fly list

2009-12-17 Thread Romain Francois
e same errors if I bypass rm entirely and use .Internal(remove(delList, globalenv(),FALSE)). I am using R version 2.10.0 running on a windows 7 box. I want to declare the clean-up within a function for design purposes. The full project is spread over several files and I am trying to keep the

Re: [R] How to find the significant digits of a number?

2009-12-16 Thread Romain Francois
ps: > foo <- function( x, y) abs( round( 10^y * (x - signif(x,y) ) ) ) > foo( 3.1415, 4 ) [1] 5 -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/HlX9 : new package : bibtex |- http://tr.im/Gq7i : ohloh `- http://tr.im

Re: [R] Creating bibtex file of all installed packages?

2009-12-15 Thread Romain Francois
;, "\nResults written to file", file, "\n") ## return Bibtex items invisibly invisible(bibs) } Best, Z And you can read it back into R with package bibtex: > require( bibtex ) > entries <- read.bib( "Rpackages.bib" ) but then although the key is read, it

Re: [R] Literature analysis

2009-12-14 Thread Romain Francois
es? Are they in a standardised format (i.e. bibTEX or similar)? /Gustaf -- Gustaf Rydevik, M.Sci. tel: +46(0)703 051 451 address:Essingetorget 40,112 66 Stockholm, SE skype:gustaf_rydevik -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http

Re: [R] how to use Rengine instance to parse R script String

2009-12-14 Thread Romain Francois
know how to use Rengine instance to parse a R script String? if so, could you give me a small example (in Java)? i really appreciate. -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/HlX9 : new package : bibtex |- http://tr.

Re: [R] Printing to PDF in for

2009-12-14 Thread Romain Francois
t;) for (i in 1:10){ x<- seq(1,40,1) y<- 2*x+1+5*rnorm(length(x)) hist(y,freq = FALSE) plot(density(y)) } dev.off( ) but the problem is that I have a lot of other code in the cycle which I don't want to be printed in PDF. Thanks a lot for the help -- Romain Francois Professional R En

Re: [R] Why doesnot Rscript work ?

2009-12-14 Thread Romain Francois
gs(TRUE) args x<- read.csv("000301.csv") matplot(x[,1],x[,-1],type="l") #q(save="no") %Rscript stock.R 000301.csv [1] "000301.csv" matplot doesnot draw anything(no drawing window). Howeve, in R, source works great! source("stock.R") Sincerel

Re: [R] Combinations

2009-12-14 Thread Romain Francois
x, by, bz, cx, cy, cz) However, if I have say 5 variables, then total no of possible combinations will be 3^5 = 243. Thus, A = (a,b,c), B = (x, y, z), C = (l, m, n), D = (p,q,r), E = (s, t, u). Then may be my possble combination will start as (a, x, l, p, s), then next combination may be (a, x, l, p

Re: [R] How to resolve include Rcpp.h problems?

2009-12-13 Thread Romain Francois
this package has a loading problem: see the messages for details. Resulting this last error seems to be also logical. In fact, I think the file libRcpp.so is need for the compilation of my code. Please notice that the package Rcpp is installed in the following directory: /usr/lib/R/site-

Re: [R] code for [[.data.frame

2009-12-13 Thread Romain Francois
.subset2(col, i, exact = exact) } } Romain and more generally see Rnews Volume 6/4, October 2006 "Accessing the Sources". HTH, baptiste Thank you so much. Indeed, I've been able to look at the source code of the function from the source code of R

Re: [R] copyING directories and files

2009-12-11 Thread Romain Francois
he windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let me do this (something like the 'cp' command in UNIX)? I have looked at 'file.copy', but as the name implies I think it only copi

Re: [R] Creating bibtex file of all installed packages?

2009-12-11 Thread Romain Francois
enue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: rai...@krugs.de Skype: RMkrug Google: r.m.k...@gmail.com [[alternative HTML version deleted]] -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http:/

Re: [R] automated image processing

2009-12-08 Thread Romain Francois
tissues (stained) in an automatic way. I had a look on biops and EBImage (Bioconductor) but they are not automatic... Did you already use/know a such package ? Thanks, - Martial -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/Gq7i

  1   2   3   >