[R] Error using Rcpp under windows xp

2010-12-02 Thread randomcz
Hi, I am a newbie to Rcpp packages, and got problems in having basic set-ups for Rcpp under windows xp. Here is the list I have done. 1) installed Rtools and have no problem in compiling .c file. 2) installed Rcpp packages 3) set enviroment variables 'path' to make C:\Program

[R] Pass an operator to function

2010-11-30 Thread randomcz
Hi guys, How to pass an operator to a function. For example, test - function(a, , b) { return(ab) #the operator is passed as an argument } Thanks, -- View this message in context: http://r.789695.n4.nabble.com/Pass-an-operator-to-function-tp3066627p3066627.html Sent from the R help

Re: [R] Pass an operator to function

2010-11-30 Thread randomcz
Thanks, that helps. -- View this message in context: http://r.789695.n4.nabble.com/Pass-an-operator-to-function-tp3066627p3066696.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] help: program efficiency

2010-11-26 Thread randomcz
Thanks guys, the rle function works pretty well. Thank you all for the efforts. Zheng -- View this message in context: http://r.789695.n4.nabble.com/help-program-efficiency-tp3059079p3061103.html Sent from the R help mailing list archive at Nabble.com.

[R] help: program efficiency

2010-11-25 Thread randomcz
hey guys, 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) I'll like to transform it into: a.nodup = 2, 1.01, 1.02, 3.01, 3.02, 3.03, 4 basically, find the duplicates and assign a unique value by adding a small