[R] Use BatchJobs package to submit Rmpi job

2015-03-19 Thread Feng Li
.tmpl #BSUB -q mpi_job_queue /opt/openlava/bin/openmpi-mpirun -np 1 R CMD BATCH "<%= rscript %>" Please let us know your comments, Thanks, Feng Li Teraproc Inc. [[alternative HTML version deleted]] __

[R] Inverse of many small matrices

2015-04-02 Thread Feng Li
vectorize them. Can anyone give me a hint to speed this up? Thanks in advance! Feng -- Feng Li, Ph.D. School of Statistics and Mathematics Central University of Finance and Economics 100081 Beijing, China http://feng.li/ __ R-help@r-project.org mailing

Re: [R] Inverse of many small matrices

2015-04-02 Thread Feng Li
On 04/02/2015 10:40 PM, Duncan Murdoch wrote: On 02/04/2015 9:31 AM, Feng Li wrote: Dear all, I am working with a likelihood function that requires the inverse of many small covariance matrices for multivariate normal densities. When the sample size is large, this calculation is really heavy

[R] Speed up sparse matrices

2010-03-08 Thread Feng Li
ge? Thanks in advance. Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] rm(list<-ls()) error

2009-11-05 Thread Feng Li
Dear R, Why rm(list<-ls()) gives an error but rm(list=ls()) not? I remember the operator ‘<-’ can be used anywhere... Thanks! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version d

[R] rm(list<-ls()) error

2009-11-05 Thread Feng Li
Dear R, Why rm(list<-ls()) gives an error but rm(list=ls()) not?. I remember the operator ‘<-’ can be used anywhere... Thanks! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version d

[R] R-package related to the topic of INARMA models

2010-01-05 Thread Feng Li
Dear R, I am looking for R-package related to INARMA (Integer-valued ARMA). Can anyone give me some information? I did not get information from task view. Many thanks. Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li

[R] The three-dot question

2013-01-14 Thread Feng Li
print(b) + } + } > > myTask <- function(a) + { + b <- 3 + testFun(a, b = b) + } > myTask(FALSE) Error in print(b) : object 'b' not found Thanks in advance! Feng -- Feng Li Department of Statistics Stockholm University SE-106 9

Re: [R] The three-dot question

2013-01-14 Thread Feng Li
u just copy and paste it. If it bites you, the mouse and keyboard did it:) Cheers, Feng > > Cheers, > Michael > > > On Mon, Jan 14, 2013 at 10:21 AM, Feng Li wrote: > > Dear all, > > > > Why does not the three-dot accept arguments from the parent env

Re: [R] The three-dot question

2013-01-14 Thread Feng Li
"x"), "\n"); > g(...) } > f(x = 3, y = 4) > f: exists('x') = FALSE > g: exists('x') = TRUE > $y > > > > > On Mon, Jan 14, 2013 at 5:21 AM, Feng Li wrote: > Dear all, > > Why does not the t

[R] How to generate a particular sequence ?

2010-09-13 Thread Feng Li
Many many thanks! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Feng Li
Sorry. It was my typo. Should be three times as it in the example. Feng On Mon, Sep 13, 2010 at 11:32 AM, Jim Lemon wrote: > On 09/13/2010 07:19 PM, Feng Li wrote: > >> Dear R, >> >> I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array >>

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Feng Li
Thanks. That's what I want. Sorry for the typo:) Feng On Mon, Sep 13, 2010 at 11:42 AM, Ted Harding wrote: > On 13-Sep-10 09:19:21, Feng Li wrote: > > Dear R, > > I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector > > or array (2-by-

[R] boundary check

2010-09-24 Thread Feng Li
with 1-D or 2-D, but I don't knot how to manage it when the dimension is large. Can someone give a hint? Thanks in advance! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]] _

Re: [R] boundary check

2010-09-24 Thread Feng Li
rs){ >     return(jj) >   }  else { >     return((jj$solved >= 0) & all(jj$soln<1)) >   } > > } > > isin.chull(x_i,X) > [1] FALSE > > (we can discuss offline; I'll summarize) > > HTH > > rksh > > On 24/09/10 10:44, Feng Li wrote: &

Re: [R] Intel i7 utilization

2010-10-05 Thread Feng Li
Intel core 2 CPU which works well. But I haven't tried with i7 CPU. Feng On 10/05/2010 12:42 PM, Costas wrote: Hello, Is there a way to force through R the amount of the cpu's cores (or the cpu's utilization level) used under Windows 7 or Linux? Thanks, Costas -- F

[R] lapply to subsets

2010-10-12 Thread Feng Li
the above task but take away some burn-in, e.g. do not take A$a[,,1:2],and A$b[,,1:2] into account. How can I do then? Thanks! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version dele

Re: [R] lapply to subsets

2010-10-12 Thread Feng Li
Yes, that is what I what... Thanks. Feng On Wed, Oct 13, 2010 at 6:38 AM, Michael Bedward wrote: > Hello Feng, > > I think you just want this... > > lapply(A, function(x) apply(x[,,-c(1,2)], c(1,2), mean)) > > Michael > > > On 13 October 2010 04:00, Feng Li wrote

[R] How to disable using "enter" key to exit the browser in debugging mode

2011-01-12 Thread Feng Li
y starting from this line ## test <- function() { x<- 5 browser() y<-4 } test() end of copy at this line Any suggestions are most welcome! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockhol

Re: [R] How to disable using "enter" key to exit the browser in debugging mode

2011-01-13 Thread Feng Li
r Eclipse. > > Of course, using a new IDE is a big undertaking, but I can assure you: it's > worth it! This is just one small benefit. > > On Wed, Jan 12, 2011 at 4:00 PM, Feng Li wrote: > >> Dear R, >> >> How can I disable using "enter" key to e

Re: [R] How to disable using "enter" key to exit the browser in debugging mode

2011-01-13 Thread Feng Li
w other experienced R users have never encountered this. But if you > wish you could submit this as a 'wishlist' request to R-bugs, and if enough > users support it (and especially if someone submits a high-quality patch to > do this), it might be added in a future release

[R] Convert a matrix's columns to list

2011-01-18 Thread Feng Li
ould like to have a list "b" like this > b <- list(a[, 1], a[, 2]) > b [[1]] [1] 1 2 3 4 5 [[2]] [1] 6 7 8 9 10 Thanks in advance! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/

[R] a^c(1:3)

2010-09-07 Thread Feng Li
hen I put another element in the exponent part like this, > a^c(2, 3, 4) [,1] [,2] [,3] [1,]1 81 125 [2,]8 16 1296 BTW, I have a 64bit R version (2.11) for Linux. Any advice would be appreciated. Feng -- Feng Li Department of Statistics Stockholm University 106

Re: [R] a^c(1:3)

2010-09-07 Thread Feng Li
Very fruitful, thanks all of you:) Feng [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and prov

[R] Spare matrix multiplication

2011-01-29 Thread Feng Li
-- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Spare matrix multiplication

2011-01-29 Thread Feng Li
I meant "sparse matrix", sorry for the typo. Feng On Sat, Jan 29, 2011 at 7:02 PM, Feng Li wrote: > Dear R, > > I have a simple question concerning with a special case of sparse matrix > multiplications. Say A is a 200-by-1 dense matrix. B is a 1-by-1 > bl

Re: [R] Sparse matrix multiplication

2011-01-30 Thread Feng Li
Thanks Martin. That is exactly what I want. Feng On Sat, Jan 29, 2011 at 11:59 PM, Martin Maechler < maech...@stat.math.ethz.ch> wrote: > >>>>> "FL" == Feng Li > >>>>> on Sat, 29 Jan 2011 19:46:48 +0100 writes: > >FL> I meant

[R] kmeans: number of cluster centres must lie between 1 and nrow(x)

2011-02-01 Thread Feng Li
I known R from version 2.12 allows number of clusters to be one. So I guess allowing number of clusters to be nrow(x) should be also possible in the future release? Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML v

Re: [R] kmeans: number of cluster centres must lie between 1 and nrow(x)

2011-02-02 Thread Feng Li
m missing something here, but why would you want to create as many > clusters as there are observations? Won't the outcome just be one > observation in each cluster? > > > > -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden htt

[R] Wired behavior of a 2-by-2 matrix indicies

2011-02-26 Thread Feng Li
x4B] [1] 1 2 3 4 5 6 7 8 9 I can reproduce this for both 32bit windows and 64bit linux with R 2.12.1 and some earlier versions. Can someone tell me whether this a bug or a feature or something I don't know? Thanks! Feng -- Feng Li Department of Statistics Stockholm University 106

Re: [R] Weird behavior of a 2-by-2 matrix indicies

2011-02-26 Thread Feng Li
ector since a matrix is just a vector with dimensions attributed in R. I know I can convert them to a vector but I did not do it anyway. Thanks for this information! Feng On Sat, Feb 26, 2011 at 6:29 PM, Sarah Goslee wrote: > Hello, > > On Sat, Feb 26, 2011 at 12:11 PM, Feng Li wrote:

[R] Singularity problem

2011-03-16 Thread Feng Li
system is computationally singular: reciprocal condition number = 1e-17 Thanks in advance! Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]] __ R-help@r

Re: [R] Singularity problem

2011-03-16 Thread Feng Li
ngularity problem Peter Langfelder wrote: On Wed, Mar 16, 2011 at 8:28 AM, Feng Li<m...@feng.li> wrote: Dear R, If I have remembered correctly, a square matrix is singular if and only if its determinant is zero. I am a bit confused by the following code error. Can someone give me a hint? a<- m

[R] R gui problem for windows

2011-03-23 Thread Feng Li
be very convenient for the window users especially when they are running time consuming simulations. What do you think? Best, Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ [[alternative HTML version deleted]] ___

Re: [R] R gui problem for windows

2011-03-23 Thread Feng Li
people love R. That is all my concern. Have a good day! Feng On Wed, Mar 23, 2011 at 11:30 AM, Prof Brian Ripley wrote: > > On Wed, 23 Mar 2011, Feng Li wrote: > >> Dear R, >> >> I rare use the standard R-gui on Windows. Yesterday I tried the latest >> sta

[R] PDF help for linux

2011-04-19 Thread Feng Li
utf8 [7] LC_PAPER=en_US.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a name

[R] ess-tracebug to open a file

2012-03-13 Thread Feng Li
an.org) (gcc version 4.6.3 (Debian 4.6.3-1) ) #1 SMP Sun Mar 4 22:48:17 UTC 2012 Best regards, Feng -- Feng Li Department of Statistics Stockholm University 106 91 Stockholm, Sweden http://feng.li/ __ R-help@r-project.org mailing list https://stat.

Re: [R] #!/usr/bin/env Rscript --vanilla ??

2012-04-13 Thread Feng Li
No such file or directory I have tried a few variations on the theme, using quotes in different places, but have not succeeded till now. Any suggestions? Martin Maechler, ETH Zurich -- Feng Li Department of Statistics Stockholm University SE-106 91 Stockholm, Sweden http://feng.li/ __

Re: [R] #!/usr/bin/env Rscript --vanilla ??

2012-04-13 Thread Feng Li
No such file or directory I have tried a few variations on the theme, using quotes in different places, but have not succeeded till now. Any suggestions? Martin Maechler, ETH Zurich -- Feng Li Department of Statistics Stockholm University SE-106 91 Stockholm, Sweden http://feng.li/ __

Re: [R] While loop working with TRUE/FALSE?

2012-02-01 Thread Feng Li
se T and F. Use TRUE and FALSE. 4. If there is no element of z equal to r the loop will run forever (with the correct condition of course). A much better way of doing what you seem to be wanting is which(z == r) or possibly any(z == r) Berend -- Feng Li Department of Statistics Stockho

[R] Passing data among multiple instances

2009-02-04 Thread Feng Li
Dear R, I have two R instances running at the same time, say instance A and instance B. Is there a simpler way to pass the data in A to B? More precise, I have a stupid example: In instance A, I am running a function "test1" test1 <- function (x1) { x2 <- sin(x1) return(x2) } In inst

Re: [R] Passing data among multiple instances

2009-02-04 Thread Feng Li
Very very fruitful. Now I only do the experiment on my single computer with a Quad CPU and more than 2 G ram. Let me have a try first. Feng On Wed, Feb 4, 2009 at 4:02 PM, Warren Young wrote: > Feng Li wrote: > >> >> I have two R instances running at the same time,

Re: [R] Passing data among multiple instances

2009-02-04 Thread Feng Li
nstance B, another function "test2" >> >> test2 <- function (x2) >> { >> x3 <- cos(x2) >> return(x3) >> } >> > > > > On Wed, Feb 4, 2009 at 9:08 AM, Feng Li wrote: > > Dear R, >> >> I have two R instanc

Re: [R] Passing data among multiple instances

2009-02-04 Thread Feng Li
On Wed, Feb 4, 2009 at 4:02 PM, Warren Young wrote: > Feng Li wrote: > >> >> I have two R instances running at the same time, >> > > On the same computer, or on different computers? The first trial is only on my single computer with Quad CPU and more than 2G me

[R] How to handle large numbers?

2009-02-11 Thread Feng Li
se the following command: > exp(1000)/(exp(1007)+5) [1] NaN I am pretty sure this should be close to zero. My question is whether there is a general way to solve this kind of question or should I do some settings before computing? Thanks in advance! Feng -- Feng Li Department of S

Re: [R] How to handle large numbers?

2009-02-11 Thread Feng Li
; > > as.numeric(exp(as.brob(1000))/(exp(as.brob(1007))+5)) > [1] 0.000911882 > > > > Feng Li wrote: > >> Dear R, >> >> I have two questions: >> >> 1, Why both R and Matlab give 0*Inf==NaN? To my knowledge, it should be >> zero >> math

Re: [R] How to handle large numbers?

2009-02-11 Thread Feng Li
Thanks for your explanation. Now I am quite clear about that. On Wed, Feb 11, 2009 at 12:05 PM, Thomas Lumley wrote: > On Wed, 11 Feb 2009, Feng Li wrote: > > 1, Why both R and Matlab give 0*Inf==NaN? To my knowledge, it should be >> zero >> mathematically. Am I right? >