Displaying 11 results from an estimated 11 matches for "kindlychung".
2013 Apr 18
1
snow: cluster initialization
...= makeCluster(rep('localhost', ncore), type='SOCK')
cl = makeCluster(rep('localhost', as.integer(ncore)), type='SOCK')
no luck.
Could anyone please help? Thanks!
Best regards,
Kaiyin ZHONG
------------------------------
FMB, Erasmus MC
k.zhong@erasmusmc.nl
kindlychung@gmail.com
[[alternative HTML version deleted]]
2013 Apr 18
1
parSapply can't find function
...ly(k, function(i) predR(x, i))
}
r = testK()
stopCluster(cl)
Here is the error:
Error in checkForRemoteErrors(val) :
8 nodes produced errors; first error: could not find function "predR"
Best regards,
Kaiyin ZHONG
------------------------------
FMB, Erasmus MC
k.zhong@erasmusmc.nl
kindlychung@gmail.com
[[alternative HTML version deleted]]
2011 Nov 23
2
Is there an easier way to iterate over multiple data frames in R?
> for (d in paste('df', 1:3, sep='')) {
+ assign(d, as.data.frame(replicate(3, rnorm(4))))
+ }
> dats = list(df1,df2,df3)
> for (i in 1:length(dats)) {
+ names(dats[[i]]) = c('w', 'l', 'h')
+ }
> dats
[[1]]
w l h
1 1.24319239 -0.05543649 0.05409178
2 0.05124331 -1.89346950 0.33896273
3 -1.69686777 -0.35963008
2011 Nov 03
1
Why can't this function be used with the 'by' command?
Why can't this function be used with the 'by' command?
> x = array(runif(16), dim=c(8,2))
> x = data.frame(x)
> x$group = rep(c('wt', 'app'), each=4)
> shapiro.p = function(x) shapiro.test(x)[[2]]
> apply(x[,1:2], 2, shapiro.p)
X1 X2
0.4126345 0.2208781
> by(x[,1:2], x$group, shapiro.p)
Error in `[.data.frame`(x, complete.cases(x)) :
2011 Dec 08
1
How to plot multiple graphs in one go?
I am trying to do this, but it won't work:
> library(lattice)
> elemconc = data.frame(expand.grid(id=1:20, geno=c('exp', 'wt'),
region=c('cor', 'cr', 'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(360,
10))
> elemconc$geno = factor(elemconc$geno)
> elemconc$region = factor(elemconc$region)
> for (i in
2013 Aug 25
0
"block incomplete" error when compiling R
...ompiling several versions including
3.0.0 and 2.15.3.
The commands used are those introduced in R-admin:
./configure
make
or
./configure LIBnn=lib
make
Any ideas? Thanks!
Best regards,
Kaiyin ZHONG
------------------------------
Forensic Molecular Biology, Erasmus MC
k.zhong@erasmusmc.nl
kindlychung@gmail.com
[[alternative HTML version deleted]]
2014 Nov 10
1
Cursor not behaving properly
I found a strange bug in R recently (version 3.1.2):
As you can see from the screenshots attached, when the cursor passes the
right edge of the console, instead of start on a new line, it goes back to
the beginning of the same line, and overwrites everything after it.
This happens every time the size of the terminal is changed, for example,
if you fit the terminal to the right half of the
2011 Dec 23
2
cast in reshape and reshape2
> library(reshape2)
> x = melt(airquality, id=c('month', 'day'))
With reshape I can cast with multiple functions:
> library(reshape)
> cast(x, month+variable~., c(mean,sd))
month variable mean sd
1 5 ozone 23.615385 22.224449
2 5 solar.r 181.296296 115.075499
3 5 wind 11.622581 3.531450
4 5 temp 65.548387
2011 Nov 05
1
Correlation between matrices
> regions = c('cortex', 'hippocampus', 'brain_stem', 'mid_brain',
'cerebellum')
> mice = paste('mouse', 1:5, sep='')
> for (n in c('Cu', 'Fe', 'Zn', 'Ca', 'Enzyme')) {
+ assign(n, as.data.frame(replicate(5, rnorm(5))))
+ }
> names(Cu) = names(Zn) = names(Fe) = names(Ca) = names(Enzyme) =
2011 Dec 04
1
Complex multiple t tests in a data frame with several id factors
I have assayed the concentrations of various metal elements in
different anatomic regions of two strains of mice. Now, for each
element, in each region, I want to do a t test to find whether there
is any difference between the two strains.
Here is what I did (using simulated data as an example):
# create the data frame
> elemconc = data.frame(expand.grid(id=1:3, geno=c('exp',
2011 Nov 24
1
what is wrong with this dataset?
> d = data.frame(gender=rep(c('f','m'), 5), pos=rep(c('worker', 'manager',
'speaker', 'sales', 'investor'), 2), lot1=rnorm(10), lot2=rnorm(10))
> d
gender pos lot1 lot2
1 f worker 1.1035316 0.8710510
2 m manager -0.4824027 -0.2595865
3 f speaker 0.8933589 -0.5966119
4 m sales