Re: [R] an easy way to construct this special matirx
Hi wen, I don't think it is easy to construct this matrix in a simple way. I tried and found a way to do it. Try the following codes: i-1:4 j-5 aa-matrix(0,4,5) for (j in 1:5){aa[i,j]-(i+1-j)} r-4 #r could be any number bb-r^aa bb[aa0]=0 bb The matrix bb is what you want. Furthermore,I packaged this process into a function called mtrx as below: mtrx-function(row,clm,r){ i-1:row j-clm aa-matrix(row*clm,row,clm) for (j in 1:clm){aa[i,j]-(i+1-j)} #r could be any number bb-r^aa bb[aa0]=0 bb } Now you can use the function to produce the matrix.The above-mentioned matrix is mtrx(4,5,4) Dejian Zhao On Thu, Aug 16, 2007 11:10, [EMAIL PROTECTED] wrote: Hi, Sorry if this is a repost. I searched but found no results. I am wondering if it is an easy way to construct the following matrix: r 1 0 00 r^2 r 1 00 r^3 r^2 r 10 r^4 r^3 r^2 r1 where r could be any number. Thanks. Wen [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code. -- De-Jian Zhao Institute of Zoology,Chinese Academy of Sciences +86-10-64807217 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] an easy way to construct this special matirx
Hi Gabor, I am glad to see your answer,which gives a hope to resove this question in an easy way. I replied to this question in a more complex way before seeing your answer. However,I think your code needs some revision, because the original matrix is not a diagonal matrix. It has 4 rows and 5 columns.Looking forward to your revised codes. Best regards, On Thu, Aug 16, 2007 20:22, Gabor Grothendieck wrote: Here are two solutions. In the first lo has TRUE on the lower diagonal and diagonal. Then we compute the exponents, multiplying by lo to zero out the upper triangle. In the second rn is a matrix of row numbers and rn = t(rn) is the same as lo in the first solution. r - 2; n - 5 # test data lo - lower.tri(diag(n), diag = TRUE) lo * r ^ (row(lo) - col(lo) + 1) Here is another one: rn - row(diag(n)) (rn = t(rn)) * r ^ (rn - t(rn) + 1) On 8/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Sorry if this is a repost. I searched but found no results. I am wondering if it is an easy way to construct the following matrix: r 1 0 00 r^2 r 1 00 r^3 r^2 r 10 r^4 r^3 r^2 r1 where r could be any number. Thanks. Wen __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code. -- De-Jian Zhao Institute of Zoology,Chinese Academy of Sciences +86-10-64807217 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] X11 problems
Hi Pau, The error message indicates that the Font Path is perhaps wrong. I think you should set the font path. I do not use Linux. I never encounter this problem in Windows XP. About the warning messages, you can try ?locales to get some information. These warnings do not prevent the function from working. -- On Wed, Aug 15, 2007 10:03, Pau Marc Munoz Torres wrote: Hi I'm working in a ubuntu feisty OS, when I try to start X11() i get the following message X11() Error in X11() : could not find any X11 fonts Check that the Font Path is correct. In addition: Warning messages: 1: locale not supported by Xlib: some X ops will operate in C locale 2: X cannot set locale modifiers Can some body tell me what to do? -- Pau Marc Mu�oz Torres Laboratori de Biologia Computacional Institut de Biotecnologia i Biomedicina Vicent Villar Universitat Autonoma de Barcelona E-08193 Bellaterra (Barcelona) tel�fon: 93 5812807 Email : [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code.
Re: [R] clustering on Trinary data
Try Cluster 3.0. http://bonsai.ims.u-tokyo.ac.jp/~mdehoon/software/cluster/software.htm Dear all, I have a data matrix with 7 independent variables, and each of them is a trinary variable ( - 1, 0 , 1), and I would like to know what kinds of R package or method I should use to perform the clustering. Thanks for any comment or suggestion. -- Lam C. Tsoi (Alex) Medical University of South Carolina [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code.
[R] problems in limma
Dear list members, I am analysing my microarray data using limma package. Now I encounter several problems. Looking forward to your suggestions! Question 1: During the process of background correction using method=normexp, four warning messages appeared as NaNs produced in: log(x) (as you can see in the program posted below). What does that mean? How will it effect the final result? How could it be settled? Question 2: On my microarray, every probe has two replicates.During the process of duplicateCorrelation, two warnings appear as Too much damping - convergence tolerance not achievable (as you also can see in the program posted below). What does it mean? Is there anything wrong with my data? Question 3: How to construct the design matrix is a puzzle to me. Here I constructed the design matrix using the function modelMatrix and the object targets. However, I am not sure whether it is constructed appropriately. Looking forward to your suggestions. (Additional info about my experimental design. Uppercase and lowercase words in the R object targets (see below in the posted program) have different meanings. The locusts on the plain [PLAIN] was treated [plain] in a simulated plateau environment while the locusts on the plateau [PLATEAU] was treated [plateau] in a simulated plain environment. They experienced different treatments. I think it is not a complete factorial design. Therefore I did not choose the design matrix for factorial designs. However, I do not know whether what I chose is appropriate.) Question 4: All in all, I wonder whether the differentially expressed genes produced via the posted program are convincing. Will the above-mentioned warnings affect the reliability of the final result? Can I continue to the next step? Thanks! Dejian Zhao ++ Program Starts + library(limma) library(statmod) #duplicateCorrelation requires this package. targets-readTargets() targets Cy3 Cy5 FileName Date 1PLAIN PLATEAU Locust 186.gpr 2006-5-31 2PLAIN PLATEAU Locust 187.gpr 2006-5-31 3PLAIN PLATEAU Locust 188.gpr 2006-5-31 4PLAIN PLATEAU Locust 189.gpr 2006-5-31 5PLAIN PLATEAU Locust 190.gpr 2006-5-31 6PLAIN PLATEAU Locust 191.gpr 2006-5-31 7plain PLAIN Locust 192.gpr 2006-6-6 8plain PLAIN Locust 193.gpr 2006-6-6 9plain PLAIN Locust 194.gpr 2006-6-6 10 plain PLAIN Locust 195.gpr 2006-6-6 11 plain PLAIN Locust 196.gpr 2006-6-6 12 plain PLAIN Locust 197.gpr 2006-6-6 13 plateau PLATEAU Locust 198.gpr 2006-6-8 14 plateau PLATEAU Locust 199.gpr 2006-6-8 15 plateau PLATEAU Locust 200.gpr 2006-6-8 16 plateau PLATEAU Locust 201.gpr 2006-6-8 17 plateau PLATEAU Locust 202.gpr 2006-6-8 18 plateau PLATEAU Locust 203.gpr 2006-6-8 RG-read.maimages(targets,source=genepix,wt.fun=wtflags(0.1)) Read Locust 186.gpr Read Locust 187.gpr Read Locust 188.gpr Read Locust 189.gpr Read Locust 190.gpr Read Locust 191.gpr Read Locust 192.gpr Read Locust 193.gpr Read Locust 194.gpr Read Locust 195.gpr Read Locust 196.gpr Read Locust 197.gpr Read Locust 198.gpr Read Locust 199.gpr Read Locust 200.gpr Read Locust 201.gpr Read Locust 202.gpr Read Locust 203.gpr RG$genes-readGAL() spottypes-readSpotTypes() spottypes SpotType ID Name Color 1 gene ** black 2 blank Blank* brown 3 buffer*sc* blue 4 rice Os026** green 5 beta-actin Beta**red 618S 18S** yellow 7 GAPDH GAPDH** purple RG$genes$Status-controlStatus(spottypes,RG) Matching patterns for: ID Name Found 19200 gene Found 96 blank Found 220 buffer Found 192 rice Found 192 beta-actin Found 96 18S Found 96 GAPDH Setting attributes: values Color RG.b-backgroundCorrect(RG,method=normexp,offset=0) Corrected array 1 Corrected array 2 Corrected array 3 Corrected array 4 Corrected array 5 Corrected array 6 Corrected array 7 Corrected array 8 Corrected array 9 Corrected array 10 Corrected array 11 Corrected array 12 Corrected array 13 Corrected array 14 Corrected array 15 Corrected array 16 Corrected array 17 Corrected array 18 Warning messages: 1: NaNs produced in: log(x) 2: NaNs produced in: log(x) 3: NaNs produced in: log(x) 4: NaNs produced in: log(x) w-modifyWeights(RG$weights,RG$genes$Status,c(rice,beta-actin,18S,GAPDH),c(0.1,2,2,2)) MA.p-normalizeWithinArrays(RG.b,weights=w,iterations=6) design-modelMatrix(targets,ref=PLAIN) Found unique target names: plain PLAIN plateau PLATEAU design plain plateau PLATEAU [1,] 0 0 1 [2,] 0 0 1 [3,] 0 0 1 [4,] 0 0 1 [5,] 0 0 1 [6,] 0 0 1 [7,]-1 0 0 [8,]-1 0 0 [9,]-1 0 0 [10,]-1 0 0 [11,]-1 0 0 [12,]-1 0 0 [13,] 0 -1 1 [14,] 0 -1 1 [15,] 0 -1 1 [16,] 0 -1 1 [17,] 0
[R] look for packages
Dear list members, I am analysing some microarray data. I have got the differentially expressed genes and now want to carry out PCA analysis to get the main components that contribute to the variance.I have browsered the CRAN and BioConductor and did not find an appropriate package. Have anybody ever carried out PCA analysis? Is there any package about PCA in R? Thanks for your advice. __ R-help@stat.math.ethz.ch 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 provide commented, minimal, self-contained, reproducible code.