[R] (no subject)

2014-08-17 Thread Kaiyin Zhong (Victor Chung)
Hi all. I am having problems with inheritance in reference class, here is a small example: Myclass = setRefClass(Myclass, fields = list( fa = numeric, fb = numeric, filename = character,

[R] block incomplete error when compiling R

2013-08-25 Thread Kaiyin Zhong (Victor Chung)
Dear list, I am trying to compile R on a 64-bit Ubuntu 13.04 machine and get the following error: make[2]: Entering directory `/home/kaiyin/opt/R-2.15.0/src/library/Recommended' begin installing recommended package MASS Error in untar2(tarfile, files, list, exdir) : incomplete block on file

[R] hclust segfault when using rpuDist

2013-06-04 Thread Kaiyin Zhong (Victor Chung)
Hi, dear list. I found that hclust causes segfault in R 3.0.1, here is the code after starting R --vanilla: test.data - function(dim, num, seed=17) { set.seed(seed) matrix(rnorm(dim * num), nrow=num) } m - test.data(120, 45) library(rpud) # load rpud with rpudplus d -

[R] gpuHclust slower than hclust

2013-06-04 Thread Kaiyin Zhong (Victor Chung)
Dear list, According to this presentation ( http://www.rinfinance.com/agenda/2010/MarkSeligman_Tutorial.pdf), gpuHclust in the gputools package should be about 20x faster than clust, but after some testing, I find it actually 4x slower. Here is the code: test.data - function(dim, num, seed=17) {

Re: [R] parSapply can't find function

2013-04-29 Thread Kaiyin Zhong (Victor Chung)
error: could not find function predR Best regards, Kaiyin ZHONG -- FMB, Erasmus MC k.zh...@erasmusmc.nl kindlych...@gmail.com On Tue, Apr 23, 2013 at 3:44 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 23.04.2013 15:00, Kaiyin Zhong (Victor Chung

Re: [R] parSapply can't find function

2013-04-29 Thread Kaiyin Zhong (Victor Chung)
...@erasmusmc.nl kindlych...@gmail.com On Tue, Apr 23, 2013 at 3:44 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 23.04.2013 15:00, Kaiyin Zhong (Victor Chung) wrote: Thanks for the reply. How can i make the functions known to all nodes? See ?clusterEvalQ you

Re: [R] parSapply can't find function

2013-04-29 Thread Kaiyin Zhong (Victor Chung)
. Best regards, Kaiyin ZHONG -- FMB, Erasmus MC k.zh...@erasmusmc.nl kindlych...@gmail.com On Mon, Apr 29, 2013 at 8:26 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote: On 29/04/2013 2:16 PM, Kaiyin Zhong (Victor Chung) wrote: Hi, Uwe. I still don't get how

Re: [R] parSapply can't find function

2013-04-23 Thread Kaiyin Zhong (Victor Chung)
:11, Kaiyin Zhong (Victor Chung) wrote: Here is the code, assuming 8 cores in the cpu. library('modeest') library('snow') cl = makeCluster(rep('localhost', 8), 'SOCK') x = vector(length=50) x = sapply(x, function(i) i=sample(c(1,0), 1)) pastK = function(n, x, k) { if (nk) { return(x

[R] snow: cluster initialization

2013-04-18 Thread Kaiyin Zhong (Victor Chung)
Dear all, I found a strange thing with the snow package. This will work: y = matrix(1:4, 2) cl = makeCluster(rep('localhost', 8), type='SOCK') parMM(cl, y, y) This will not: y = matrix(1:4, 2) ncore = system('nproc') parMM(cl, y, y) Error in cut.default(i, breaks) : invalid number of intervals

[R] parSapply can't find function

2013-04-18 Thread Kaiyin Zhong (Victor Chung)
Here is the code, assuming 8 cores in the cpu. library('modeest') library('snow') cl = makeCluster(rep('localhost', 8), 'SOCK') x = vector(length=50) x = sapply(x, function(i) i=sample(c(1,0), 1)) pastK = function(n, x, k) { if (nk) { return(x[(n-k):(n-1)]) } else {return(NA)} } predR

Re: [R] snow: cluster initialization

2013-04-18 Thread Kaiyin Zhong (Victor Chung)
Best wishes, Jon On 18-Apr-13 10:52, Kaiyin Zhong (Victor Chung) wrote: Dear all, I found a strange thing with the snow package. This will work: y = matrix(1:4, 2) cl = makeCluster(rep('localhost', 8), type='SOCK') parMM(cl, y, y) This will not: y = matrix(1:4, 2) ncore = system

Re: [R] snow: cluster initialization

2013-04-18 Thread Kaiyin Zhong (Victor Chung)
# the result is printed, not returned Best wishes, Jon On 18-Apr-13 10:52, Kaiyin Zhong (Victor Chung) wrote: Dear all, I found a strange thing with the snow package. This will work: y = matrix(1:4, 2) cl = makeCluster(rep('localhost', 8), type='SOCK') parMM(cl, y, y) This will not: y