[R] How the change the dimension of an individual cell [i.e. the cell corresponding to an observation in data matrix] in a heatmap.2?

2010-03-06 Thread Sunny Srivastava
Dear R-Helpers, I have a short question related to heatmap.2 function. I wanted to change the dimension of each cell in the heatmap drawn by this function. here is a reproducible example from the help page library(gplots) data(mtcars) x <- as.matrix(mtcars) rc <- rainbow(nrow(x), start=0, end=.

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Sunny Srivastava
Dear Haneef, Pls see if this suits your requirement. sim.norm = rnorm(1,mean=a,sd=sqrt(b)) mean.est = mean(sqrt(sim.norm)) Thx S. On Sat, Apr 10, 2010 at 9:31 PM, Haneef Anver wrote: > Hi all, > > > I am trying to find the expectation of x^1/2 where x~N(a,b) ( Normal with > mean a and vari

Re: [R] a bug with Student t-value??

2009-11-07 Thread Sunny Srivastava
Hi Huaru, Are you sure you are looking at 0.95 and NOT 0.975? as qt(0.975,9) = 2.262 generally tables are given for alpha/2 (alpha=0.05 in your case) significance. Please check carefully. Thx, S. On Sat, Nov 7, 2009 at 4:02 AM, huaru wang wrote: > Hello, every one, > > Using the qt() functio

[R] Lattice : Help with changing the labels of x-axis in respective panels

2009-12-03 Thread Sunny Srivastava
Dear R-Helpers, I am not very experienced in using lattice and I am still in the learning stage I have a data set which looks like this: (I have deleted a few lines in order to save space) Chromosome marker Marker.Name Distance 1 1 1 PeMm261 0. 2 1 2

[R] Problems in installing MCMCglmm package

2009-12-20 Thread Sunny Srivastava
Dear R-Helpers, I am having troubles with installing with MCMCglmm package and I get the following error with a package "Matrix" Warning in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : there is no package called 'Matrix' Error: package 'Matrix' could not be loa

[R] Using apply function on duplicates in a data.frame

2010-01-31 Thread Sunny Srivastava
Dear R-Helpers, I have a data.frame (df) and the head of data.frame looks like ProbeUID ControlType ProbeName GeneName SystematicName 1665 1577 0 pSysX_50_22_1 pSysX_50 pSysX_50 5422 5147 0 pSysX_49_8_1 pSysX_49 pSysX_49 4042 3843 0 p

Re: [R] Using apply function on duplicates in a data.frame

2010-01-31 Thread Sunny Srivastava
Thanks a lot. All the three approaches work for me! On Sun, Jan 31, 2010 at 10:43 PM, hadley wickham wrote: > On Sun, Jan 31, 2010 at 5:05 PM, Sunny Srivastava > wrote: > > Dear R-Helpers, > > I have a data.frame (df) and the head of data.frame looks like > > >

[R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Sunny Srivastava
Hello R-helpers: I think there is some problem with my code, but I would like to seek you help because I can't spot it. I have a data.frame defined as follows: testdf <- structure(list(yy = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("R", "L"), class =

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Sunny Srivastava
for the color key limits. Best, Sanvesh On Sun, Jul 6, 2014 at 11:59 PM, David Winsemius wrote: > > On Jul 6, 2014, at 4:35 PM, Sunny Srivastava wrote: > > > Hello R-helpers: > > > > I think there is some problem with my code, but I would like to seek you >

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-07 Thread Sunny Srivastava
= 0.5, > rot = 90), > y = list(cex = 0.5), > alternating = FALSE), > xlim = c(0, 50), > colorkey = list(labels = paste(seq(-0.2,0, 0.025)), >

[R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
Dear R-Helpers, I have a list l1 like: l1[[1]] a b c l1[[2]] d l1[[3]] e f I want an output res like: res[[1]] 1 1 1 res[[2]] 2 res[[3]] 3 3 Essentially, I want to replicate each index equal to the number of elements present in that index. Below is what I do to accomplish this: l1 <- list

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
spec...@stat.berkeley.edu > > > > On Mon, 13 Sep 2010, Sunny Srivastava wrote: > > Dear R-Helpers, >> I have a list l1 like: >> >> l1[[1]] >> a b c >> >> l1[[2]] >> d >> >> l1[[3]] >> e f >> >&

[R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Sunny Srivastava
Hello R-Helpers, I have a question about extracting the clusters of genes after we make the heatmap (say ht4) using the heatmap.2 function. Basically, I want to get the clusters which are shown as row dendrogram in the heatmap. I understand that ht4$rowDendrogram is an object of dendrogram and it

Re: [R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Sunny Srivastava
nd getS3method("cut", > "dendrogram"). > > Sorry I can't help more. Being a simple soul I find hclust objects so > much easier to deal with ! > > Michael > > > On 17 September 2010 11:30, Sunny Srivastava > wrote: > > Hello R-Helpers,

Re: [R] Split-split plot design with aov function in R

2010-09-27 Thread Sunny Srivastava
http://www.amazon.com/Statistical-Design-George-Casella/dp/1441926143/ref=sr_1_1?s=gateway&ie=UTF8&qid=1285609902&sr=8-1 Hello Mohd. Yaseen, Please check out the book by Dr. Casella and his website www.stat.ufl.edu/~casella for the relevant R codes. Chapter 5 of this book talks about Split Split P

[R] [plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function

2010-12-06 Thread Sunny Srivastava
Dear R-Helpers: I am using trying to use *ddply* to extract min and max of a particular column in a data.frame. I am using two different forms of the function: ## var_name_to_split is a string -- something like "var1" which is the name of a column in data.frame ddply( df, .(as.name(var_name_to_

Re: [R] [plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function

2010-12-06 Thread Sunny Srivastava
, 2010 at 5:28 PM, Hadley Wickham wrote: > On Mon, Dec 6, 2010 at 3:58 AM, Sunny Srivastava > wrote: > > Dear R-Helpers: > > > > I am using trying to use *ddply* to extract min and max of a particular > > column in a data.frame. I am using two d

Re: [R] [plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function

2010-12-06 Thread Sunny Srivastava
ot;cyl")), mtcars) > > But you shouldn't need to do any syntactic hackery because the default > method automatically parses the string for you: > > eval.quoted(as.quoted("cyl"), mtcars) > > Hadley > > On Mon, Dec 6, 2010 at 6:22 PM, Sunny Srivasta

Re: [R] P values

2010-05-08 Thread Sunny Srivastava
Dear R-Users, This list is observed by many great statisticians and non-statisticians. I just want to add this valuable link to this great discussion. http://www.stat.duke.edu/~berger/p-values.html Thanks and Best Regards, S. On Sat, May 8, 2010 a