Re: [R] speed of a vector operation question

2013-04-26 Thread lcn
I think the sum way is the best. On Fri, Apr 26, 2013 at 9:12 AM, Mikhail Umorin wrote: > Hello, > > I am dealing with numeric vectors 10^5 to 10^6 elements long. The values > are > sorted (with duplicates) in the vector (v). I am obtaining the length of > vectors such as (v < c) or (v > c1 & v

Re: [R] Read big data (>3G ) methods ?

2013-04-26 Thread lcn
Do you really have the need loading all the data into memory? Mostly for large data set, people would just read a chunk of it for developing analysis pipeline, and when that's done, the ready script would just iterate through the entire data set. For example, the read.table function has 'nrow' and

Re: [R] Transferring R to another computer, R_HOME_DIR

2013-04-25 Thread lcn
Well, to my understanding, you planned to rsync the original compiled folder from one machine to somewhere on another machine, and work with it. Then how about create a file link on the second machine for "/usr/lib64/R"? Or maybe I misunderstand your purpose? On Thu, Apr 25, 2013 at 5:57 PM, Sapt

[R] Input Chinese characters not correctly echoed in ESS

2013-04-25 Thread lcn
I had this weird encoding issue for my Emacs and R environment. Display of Chinese characters are all good with my .Rprofile setting Sys.setlocale("LC_ALL","zh_CN.utf-8"); except the echo of input ones. > linkTexts[5] font "使用帮助" > functionNotExist() 错误: 没æœ

Re: [R] Using Java methods in R

2011-04-27 Thread lcn
I guess your failure of getting two dimensional array may be related to this : http://www.rforge.net/rJava/news.html "0.9-0 (under development) o fixes issues introduced by several new features in the late 0.8 series. Most imporantly .jarray() and .jevalArray() behave as int

Re: [R] Assignments inside lapply

2011-04-27 Thread lcn
unlist(lapply(1:nrow(ij),function(rowId) { return (Powermap[i,j]<-Pr(c(ij$i[rowId],ij$j[rowId]),c(PRX,PRY),f)) }))lapply actually catches each return value of the excuted function. here your function actually returns nothing if the assignment succeeds. If your purpose for the call to Pr is jus

Re: [R] Using Java methods in R

2011-04-25 Thread lcn
> for(i in 1:3) for(j in 1:4) print(ar34Ret(i,j),digits=15) >Error in print(ar34Ret(i, j), digits = 15) : > could not find function "ar34Ret" The way you used ar34Ret(i, j) was actually wrong. It should be ar34Ret[i, j], if nothing else wrong. At 2011-04-25 08:06:51£¬hill0093 wrote: >I added

Re: [R] Using Java methods in R

2011-04-25 Thread lcn
you should take a look at the doc of .jarray by input "?.jarray" in the console and see related examples by "example(.jarray)" in the console. This is what the doc says, and your issues might be related to it: '.jevalArray' currently supports only a subset of all possible array types. R

Re: [R] Using Java methods in R

2011-04-23 Thread lcn
Well, the call to Java methods should be really simple in rJava. What you had tried is actually correct, initialize jvm, create an object, then call method. For the error you met, maybe you should check .jaddClassPath. At 2011-04-23 20:58:22£¬hill0093 wrote: >That's more than I can understand

Re: [R] R gui on windows how to force to always show the last line of output

2011-04-03 Thread lcn
CTRL+L helps. 2011/4/2 stan zimine > Hi. > Googled but did not found the answer for the following little issue. > > how to force R gui on windows (maybe a specific setting) to always > show the last line of output in the window console. > > > My program in R makes measurements every 5 mins in

Re: [R] recommendation on r scripting tutorial?

2011-04-03 Thread lcn
The documents accompanying the distribution can be a good start. And a suggestion for searching help on R over Google, use "r-help" as a basic keyword, coz a single letter of "r" hardly helps you find the desired topics. 2011/4/2 Wensui Liu > Good morning, dear listers > > I am wondering if you

Re: [R] JRI & plot( )

2011-01-06 Thread lcn
I dont think JRI can correctly handle plots from R. In my opinion, JRI is designed mainly for data sending and receiving. Plot issues should be addressed in Java, if you use R as part of your computing engine. 2011/1/7 ying zhang > Hi Everyone, > > > > Thanks a lot for your guys help, I finally

Re: [R] Converting Fortran or C++ etc to R

2011-01-05 Thread lcn
I did a quick search for interfacing R and Fortran. Found this past information. Hope it helps. :D http://r.789695.n4.nabble.com/Conerned-about-Interfacing-R-with-Fortran-td887428.html As for your actual requirement to do the "convertion", I guess there'd not exist any quick ways. You have to be b

Re: [R] Navigating web pages using R

2011-01-05 Thread lcn
You are talking about dig the data from a dynamic webpage. The data displayed to you, I guess, is fetched via filtering from certain database. And the dropdowns you saw in the page must be some sort of widgets to do these filtering. Some sites offer this filtering via URL parsing, where the final

Re: [R] Odp: R-way to doing this?

2010-12-22 Thread lcn
Aggreed. R's own way of handling logrithm of a negative number makes scripting more automatic, which is actually desireable. To flag any problems that might occur in calculation, do it ahead of using logrithm or in other similar situations. Try test functions like is.nan(), is.finite(), or relation