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

2014-04-12 Thread Romain Francois
will enjoy working with Rcpp11. Romain ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-22 Thread Romain Fenouil
Namespaces implicitly encapsulating the packages. Thank you again and I hope the package will be of interest for the community :) Romain. -- View this message in context: http://r.789695.n4.nabble.com/2-setGeneric-s-same-name-different-method-signatures-tp4658570p4659349.html Sent from the R he

Re: [R] 2 setGeneric's, same name, different method signatures

2013-02-20 Thread Romain Fenouil
very disappointing to me... I believe that these questions come from my general misunderstanding of how R OOP is designed and I would be glad to find a reference document for S4. Thank you very much for your help. Romain Fenouil. -- View this message in context: http://r.789695.n4.nabble.com/

Re: [R] Coding question for behavioral data analysis

2011-08-19 Thread Romain DOUMENC
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, as far as I understood your problem, this function might do the trick: CountNextBehavior <- function (data.source, interest.behavior, lev.ignore, interest.timeframe) { ## -- ## Ret

Re: [R] conditional data replace (recode, change or whatsoever)

2011-08-03 Thread Romain DOUMENC
Please do your homework before asking the list: An introduction to R, chapter 7 Am 03.08.2011 10:05, schrieb zcatav: > Hello, > I have a big data.frame, a piece of it as follows. > > a b c d > 1 58009 2010-11-02 0 NA > 2

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
+ 1); } } } return ScalarInteger(c); } But, when I try to compile it What does that mean ? What did you try ? R CMD SHLIB mycomin.c definitely works for me. What part of "Writing R Extensions" was not clear ? Romain I have 5 errors, and all of them come form linker and say next (C

Re: [R] Error using Rcpp under windows xp

2010-12-02 Thread Romain Francois
Hello randomcz, Thank you for your interrest in Rcpp. Rcpp has its own mailing list. http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Please subscribe and report your question there. People will be happy to help you. Romain Le 03/12/10 03:57, randomcz a écrit : Hi, I

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
r: > x <- c( 2, 1, 1, 2 ) > nodup4( sort( x ) ) [1] 1.00 1.01 2.00 2.01 > nodup_cpp( x ) [1] 2.00 1.00 1.01 2.01 Romain Le 26/11/10 20:01, William Dunlap a écrit : -Original Message- From: William Dunlap Sent: Thursday, November 25, 2010 9:31 AM To: 'randomcz'; r-he

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
2 f.Rcpp(probs) 4.614 1.0 4.3750.239 1f.R(probs) 68.645 14.8775567.7650.877 When we implement "apply" in C++, we will probably leverage loop unrolling to achieve greater performance. Romain Le 15/10/10 14:34, Douglas Bates a écrit : Although I know there i

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
Hi, You can leverage read.table using a textConnection: > txt <- "x,y,z,a,b,c,da,b,c,d,e,f,g" > con <- textConnection( gsub( "", "\\\n", txt ) ) > read.table( con, sep = "," ) V1 V2 V3 V4 V5 V6 V7 1 x y z a b c d 2 a b c d e

Re: [R] c++ equivalent switch statement?

2010-09-06 Thread romain
e snippet of what you want to reproduce in R. 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 : hi

Re: [R] Using packages built in linux in windows

2010-09-01 Thread romain
any other supported system : R CMD INSTALL wonderland Otherwise, you can use win-builder: http://win-builder.r-project.org/ Romain Le 01/09/10 17:05, rajesh j a écrit : > > Hi, > > I built a package in linux and would like to use it in windows. I cant build > the package a

Re: [R] R and Java

2010-08-20 Thread Romain Francois
me? Best regards, Perhaps you can give some more meat to your question, write some code with what you tried, why it failed, etc ... and repost on the appropriate mailing list (see above). hint: http://rforge.net/Rserve/doc/org/rosuda/REngine/REngine.html#assign%28java.lang.String,%20double[]%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
UNCALL, PREC_FN, 0}}, Then you grep for do_sample in the src/main directory, which leads you to the random.c file : /* do_sample - probability sampling with/without replacement. .Internal(sample(n, size, replace, prob)) */ SEXP attribute_hidden do_sample(SEXP call, SEXP op, SEXP args,

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
Hi, httpdPort arrived with R 2.10.0, apparently Sciviews-K relies on this, so you need to upgrade R to a newer version. Romain Le 05/08/10 19:16, Albert-Jan Roskam a écrit : Hi, I'm trying to install Sciviews-K on Linux Ubuntu 9.10 (karmic) but I'm not able to establish the

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
Hi, This is not the appropriate list for questions about Rcpp. See the Rcpp-devel mailing list, but first please think about a reproducible example. Romain Le 28/07/10 14:11, 나여나 a écrit : Hi all, How get colnames and rownames in Rcpp method? attecthed file : RGui.exe capture

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

2010-07-26 Thread Romain Francois
ce arma ; mat A = as(A_); mat L; mat U; mat P; lu(L, U, P, A); mat B = trans(P)*L*U; return List::create( _["L"] = L, _["U"] = U, _["P"] = P, _["A"] = A, _["B"] = B ) ; ', plugin = "RcppArmadil

Re: [R] problem with building package on CRAN

2010-07-26 Thread Romain Francois
ackage, it just happens sort of randomly. I believe the chances of this happening would be lower if package developers (of package using Rcpp) would be so kind and follow our guidelines, but we can only offer to write the guidelines, we cannot force them to read or apply them. Romain Le 26/0

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
rcmp2( lhs, rhs) ) I get: $ Rscript strings.R Le chargement a nécessité le package : methods utilisateur système écoulé 0.002 0.000 0.002 utilisateur système écoulé 0.004 0.000 0.005 utilisateur système écoulé 0.003 0.000

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
tr=NUMERIC_POINTER(result); double t = *REAL(s); double u = t-floor(t)-0.5; if(u>0) *ptr=-1+4*u; else *ptr=-1-4*u; Rprintf("The value is %f", *ptr); UNPROTECT(1); return result; ', verbose = TRUE ) fx( 10 ) The verbose = TRUE argument will show you how inline runs

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
access the information you are after without doing text demangling. Try completion: > string$ replace by the tab key, you should see the list of java methods associated with the java class. you can also call .jmethods > .jmethods( string ) Romain I think that there should be tr

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

2010-06-15 Thread Romain Francois
This is not the appropriate list for C-level questions. Please study the posting guide and repost on the right list. Also, you might want to also show how you actually call this from R. Are you by any chance using .External instead of .Call ? Romain Le 15/06/10 23:20, Fabian Zäpernick a

Re: [R] minor tick marks

2010-06-09 Thread Romain Francois
Hello, Perhaps something like: > axis( 2, 0:10/10, las = 1, tcl = -.2 ) Romain Le 09/06/10 11:08, Stéphane Adamowicz a écrit : Hi ! I need a plot for data extending over several orders of magnitude on the y axis. The following command generates a nice looking semi-log plot for my d

Re: [R] Highlighting Text in Console

2010-06-09 Thread Romain Francois
It depends what you mean by "console". The package xterm256 on CRAN can do some of that on xterm 256 capable consoles. See http://bit.ly/97cCbX Romain Le 09/06/10 10:50, Steve Brooks a écrit : Anyone know how I can highlight specific words/letters (e.g., bold, or differ

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
] == as.name("fun"), stack ) nameOfY <- deparse( stack.fun[[1]][[2]] ) cat("name is '",nameOfY, "'\n" , sep = "" ) } ) > titi <- "aze" > fun( titi ) name is 'titi' > fun( letters[1:4] ) name is 'letters[1

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

2010-05-11 Thread Romain Francois
mic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o hello.so hello.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation Second time: rom...@naxos /tmp $ R CMD SHLIB hello.c make: Nothing to be done for `all'. Does that help ? Ro

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
This is a known issue. You can: - ask apple to fix it - use R embedded into a java application, e.g. JGR Romain Le 08/05/10 03:49, Fredy Mejía a écrit : Hello everybody, I'm running R under Mac OS 10.6.3 on a MacBook 2.16 GHz Intel Core 2 Duo. I've recently installed R 2.11

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

2010-04-29 Thread Romain Francois
Maybe this : > foo <- function( x ){ + idx <- 1 + cumsum( is.na( x ) ) + not.na <- ! is.na( x ) + split( x[not.na], idx[not.na] ) + } > foo( x ) $`1` [1] 2 1 2 $`2` [1] 1 1 2 $`3` [1] 4 5 2 3 Romain Le 29/04/10 09:42, Tal Galili a écrit : Hi all, I would like to have

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
building a package. See http://cran.r-project.org/doc/manuals/R-admin.html#The-Windows-toolset Romain Le 09/04/10 15:11, satu a écrit : Dear Romain, I am working with a PC with Windows-XP I do have Rtools installed and running the code you propose, this is what I get as a result: code<- 

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

2010-04-08 Thread Romain Francois
Do you have the tools ? What operating system are you using ? What happens if you do this: > code <- '#include \nSEXP f(){\n return R_NilValue ; }' > writeLines( code, "test.c" ) > system( "R CMD SHLIB test.c" ) > dyn.load( "test.so" )

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

2010-04-01 Thread Romain Francois
The thread has been handled in Rcpp-devel. Rob posted there 7 minutes after posting on r-help. FWIW, I think the problem is fixed on the Rcpp 0.7.11 version (on cran incoming) Romain Le 01/04/10 17:47, Matthew Dowle a écrit : Rob, Please look again at Romain's reply to you on 19th

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
iling list for further questions. Romain Le 23/03/10 04:27, sanchow a écrit : Hello, I am having the same problem. My webmaster is not ready to install R on the web server. Is there a way to run R on a remote linux cluster and POST results from the remote server to my website? I am sorry if th

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

2010-03-22 Thread Romain Francois
have questions about xcode, ..., then a better place might be the r-sig-mac mailing list: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Romain Le 22/03/10 16:25, mans a écrit : Hi, Can anyone tell me how to embed R code in a C++ file. I am actually using a mac running on the OSX 10.6.2 an

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

2010-03-19 Thread Romain Francois
Hi, did you try to install rJava as an ubuntu package: http://packages.ubuntu.com/lucid/math/r-cran-rjava Romain Le 19/03/10 17:38, fgrazi a écrit : When I try to install rJava, I get the following error: install.packages('rJava') ... checking whether siglongjmp is decla

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

2010-03-19 Thread Romain Francois
Hello, Rcpp has a dedicated mailing list where such questions are appropriate. https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel Please augment your email with some code examples of what you tried and repost on Rcpp-devel. Romain Le 19/03/10 00:45, R_help Help a écrit

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
e( "Rcpp-introduction", package = "Rcpp" ) For semi-self-explanatory code examples, you can consult our unit tests: > system.file( "unitTests", package = "Rcpp" ) For more questions, we have a dedicated mailing list: https://lists.r-forge.r-project.org/cgi-bin/ma

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
with myRunif<- function( n, min = 0, max = 1 ){} # Start the package package.skeleton( 'RtoC' ) And if you are willing to use C++ instead of C, then install Rcpp and use the function Rcpp.package.skeleton. In addition to what package.skeleton does, it also creates C++ files and an

Re: [R] Running complete R script from Java

2010-03-05 Thread Romain Francois
You can source the script, e.g run the command : eval( "source( '" + script + "') " ) ; Questions about rJava/JRI are better on the stats-rosuda-devel mailing list: http://mailman.rz.uni-augsburg.de/mailman/listinfo/stats-rosuda-devel Romain On 03/05/2010 0

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
right, xterm256 is for manual formatting. What Liviu wants is not impossible to achieve --- it has been done for python for example [1] --- but would require some considerable effort, using for example ncurses [2] . Romain [1] http://bpython-interpreter.org/home/ [2] http://www.gnu.org/sof

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
g0c0 [] @92cf204 01 SYMSXP g0c0 [MARK,gp=0x4000] "sqrt" @97099e8 14 REALSXP g0c1 [] (len=1, tl=0) 2 @97aa84c 06 LANGSXP g0c0 [] @92cf15c 01 SYMSXP g0c0 [MARK,gp=0x4000] "trunc" @9347c38 01 SYMSXP g0c0 [MARK,gp=0x4000] "pi" Romain I use the follow

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
Hello, Maybe RInside [1] can help you embed your R script into a C++ application. Romain [1] http://dirk.eddelbuettel.com/code/rinside.html On 02/15/2010 11:37 AM, PtitBleu wrote: Hello, I discovered R two years ago and thanks to the R-community I managed to write some scripts to analyze my

Re: [R] How to repeat the names?

2010-02-10 Thread Romain Francois
Hello, That's not the problem here. The variables are read as factors. You can use the stringAsFactors argument of read.csv to turn this off: > read.csv( 'city.csv', stringsAsFactors = FALSE ) and then you can proceed as you did. Romain On 02/10/2010 10:44 AM, Paul Hi

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
Here is one way: > sprintf( "%08d", 10110 ) [1] "00010110" Romain On 02/01/2010 09:00 AM, Jägermeyr, Jonas wrote: Dear R-help members, I'm quite new to R and I apologize for my basic question, but I haven't been able to find a solution yet. I try to int

Re: [R] Error with toString

2010-01-26 Thread Romain Francois
On 01/26/2010 04:19 PM, anna wrote: Romain, I used the paste for numbers to as you told me and it worked. For the toString() function well I called it from the R console and that's what it returned me... Yes. I understood that the first time. and I asked you to provide more details about

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
nrow = m.rows() ; int ncol = m.cols() ; for( i=0; iThe indexing here is done with the round brackets here because it is just not valid to have more than one parameters passed to operator[] in C or C++. Romain On 01/23/2010 05:04 PM, Christophe Genolini wrote: Hi the list, Is t

Re: [R] Optimizing C code

2010-01-22 Thread Romain Francois
OS X and in C99), hence the workaround. This code also appears in Rmath.h */ #ifdef __cplusplus int R_isnancpp(double); /* in arithmetic.c */ # define ISNAN(x) R_isnancpp(x) #else # define ISNAN(x) (isnan(x)!=0) #endif Romain PS: the question would be more appropriate in R-devel.

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
op, SEXP args, SEXP rho) { SEXP ans, x, ap, times = R_NilValue /* -Wall */, ind; int i, lx, len = NA_INTEGER, each = 1, nt, nprotect = 4; if (DispatchOrEval(call, op, "rep", args, rho, &ans, 0, 0)) return(ans); ... } Romain cheers, Rolf Turner On 14/01

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

2010-01-14 Thread Romain Francois
Or this ; example$X3 <- c(-3, -1, 1, 3)[ example$X2 ] Romain On 01/14/2010 11:55 AM, Henrique Dallazuanna wrote: Try this: example$X3<- sapply(example$X2, switch, -3, -1, 1, 3) On Thu, Jan 14, 2010 at 5:05 AM, Joshua Wiley wrote: Hello All, I am trying to create a column of w

Re: [R] Logical function

2010-01-14 Thread Romain Francois
mp ] <- .25 n2[ s2 == mp ] <- .5 n2[ mp == 1 ] <- .75 } ) See ?within for why/how this works. Romain On 01/14/2010 11:10 AM, Olivier Deckmyn wrote: Dear all, I'm learning R, with a "classical" programming background. Some hours were necessary for me

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

2010-01-07 Thread Romain Francois
:6"))) > y a b 1 10 2 2 20 3 3 30 4 4 40 5 5 50 6 Or you can just do this : > y <- within(x, { a<-a*10; b<-2:6 } ) > y a b 1 10 2 2 20 3 3 30 4 4 40 5 5 50 6 Romain On 01/07/2010 09:08 AM, N Klepeis wrote: Hi, Why can't I pass an expression to `within'

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

2009-12-17 Thread Romain Francois
you could: suppressWarnings( rm( list = c("rv1","rv2", "rv3", "rv4") ) ) Romain On 12/17/2009 11:33 AM, Cormac Long wrote: Hello, I have the following problem when trying to use rm: In a top level script file I have a loop iterating over some index.

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
bib( "biblio.bib" ) > sapply( bib[[1]], function(item) item$title ) [1] "Adsorption and Diffusion of VO2+ and\nVO2 +\n\tacross Cation Membrane for All-Vanadium Redox Flow Battery" [2] "Modification of Daramic, microporous separator, for redox\nflow battery\n\tapplications&quo

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
See the "onefile" and "file" arguments of ?pdf and then do something like this : pdf( file = "plot-%03d.pdf", onefile = FALSE, width = 9.25, height = 9.25, family="Helvetica",pointsize=8,bg="white" ) Romain On 12/14/2009 12:09 PM, Trafim Va

Re: [R] Why doesnot Rscript work ?

2009-12-14 Thread Romain Francois
ut it will disappear at the end of the script, so not very interesting. You probably should open a png device or something and then write the grap there. See ?png, ?pdf, ?X11, ?options, ?Rscript Romain On 12/14/2009 10:59 AM, z_axis wrote: %cat stock.R #! /usr/local/bin/Rscript args<- commandAr

  1   2   3   >