search for: kaiyin

Displaying 11 results from an estimated 11 matches for "kaiyin".

2013 Aug 25
0
"block incomplete" error when compiling R
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 make[2]: *** [MASS.ts] Error 1 make[2]: Leaving directory `/home/kaiyin/opt/R-2.15.0/src/library/Recommended' make[1]: *** [recommended-pac...
2011 Dec 08
1
How to plot multiple graphs in one go?
...'spine'), elem=c('fe', 'cu', 'zn')), conc=rnorm(360, 10)) > elemconc$geno = factor(elemconc$geno) > elemconc$region = factor(elemconc$region) > for (i in as.character(levels(elemconc$region))) { + densityplot(data=elemconc, ~conc, subset=region==i) + } -- Kaiyin Zhong ------------------------------------------------------------------------------------------------------------------ Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038 [[alternative HTML version deleted]]
2013 Apr 18
1
snow: cluster initialization
...) Error in cut.default(i, breaks) : invalid number of intervals I also tried: cl = 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
...k = seq(3, 25, 2) r = parSapply(cl, k, function(i) predR(x, i)) # r = sapply(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 Dec 23
2
cast in reshape and reshape2
...34943 15 8 wind 8.793548 3.225930 16 8 temp 83.967742 6.585256 17 9 ozone 31.448276 24.141822 18 9 solar.r 167.433333 79.118280 19 9 wind 10.180000 3.461254 20 9 temp 76.900000 8.355671 Is there a way to do the same job with reshape2? -- Kaiyin Zhong ------------------------------------------------------------------------------------------------------------------ Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038
2011 Dec 04
1
Complex multiple t tests in a data frame with several id factors
...t; x = tapply(elemconc$conc, elemconc[c('elem', 'region')], function(x) t.test(x~tmpgeno) ) > x region elem brain spine fe List,9 List,9 cu List,9 List,9 zn List,9 List,9 I believe I have made no mistakes so far, but I wonder is there a better way of doing this? -- Kaiyin Zhong ------------------------------------------------------------------------------------------------------------------ Neuroscience Research Institute, Peking University, Beijing, P.R.China 100038
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)) :
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 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
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) =