[R] the problem about normalize the data frame
Hello, I'd like to normalize a data frame which are "45000 obs. of 212 variables".I want to normalize the data frame by each row. But I failed.Here is my R code, can you tell me where am I wrong? > bb<-function(normalize) (dat[i,]-min(dat[i,]))/(max(dat[i,])-min(dat[i,]))> dat1<-apply(dat,1,bb) Thanks!! vie _ [[alternative HTML version deleted]] __ R-help@r-project.org 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] problem about t test
Hello, I have a data frame >str(dat)'data.frame': 2 obs. of 30 variables it contains two information-two types of cancers:stage A(A1 to A10) and stage B(B1 to B20) ##totally 30 patients-2 sets of gene expression I'd like to find the lists for top 20 differentially expressed genes using t-test (by P-value). Here is my code, unfortunately it doesn't work...I need the help,please. I just learned R for two weeks, and hope you can give the hint! > A<-dat[,1:10] > B<-dat[,11:30]> bb<-function(t.test)+ { P.value.to.return <- > t.test(A,B)$p.value+ return(P.value.to.return)+ }> aa<-t(apply(dat,1,bb)) Thanks!! Best Regards,vie _ [[alternative HTML version deleted]] __ R-help@r-project.org 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] Hi, a problem in using SNR
Hello All, I'm going to select the differentially genes from my array by using SNR. There are two conditions:condition1:mean(group1)>mean(group2)condition2:mean(group1)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] hi, i have a problem in R
Hi, I'm new to R language. There is a problem I couldn't understand. Hope you can answer my question. when i type >for (i in 1:10){ + print(sample(9,4,replace=T)) +} and it shows ten of four numbers and how do I do to calculate the frequencies in each list? I know there is a hint; list10<-vector(mode="list",length=4) But I don't know how to use it. How do I name each list? There are my problems. Thanks!! Best Regards, vie _ Show them the way! Add maps and directions to your party invites. [[alternative HTML version deleted]] __ R-help@r-project.org 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] hi, i have a problem in R
Hi, I'm sorry i didn't say clearly. >for (i in 1:10){ + print(sample(9,4,replace=T)) + } [1] 2 5 5 2 [1] 6 2 1 5 [1] 9 5 9 7 [1] 2 6 4 1 [1] 8 5 4 5 [1] 6 2 3 7 [1] 6 1 7 3 [1] 9 5 4 7 [1] 6 4 8 5 [1] 1 5 6 3 I mean when it shows these reults. Then, what should I do to show the top 3 numbers with highest frequencies for each position. It shows ten rows and four lists. But I'd like to calculate the highest frequencies in each list. For example, in the first list, the highest frequencie is 6. Because I have to do that procedure for 100 times, and it's possible to calculate by self. Thank you!! _ [[alternative HTML version deleted]] __ R-help@r-project.org 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] Building an R package on MAC
Hi, I'm trying to build R packages. My package name is TEST. (/Users/apple/Documents/R/TEST)I type something in Terminal.But it showed an error... applede-macbook-pro:~ apple$ R CMD BUILD TESTError: cannot change to directory 'anRpackage1' I don't know where is wrong...Hope that you could help me!! Thank you!! Best Regards,Gina _ m HotmailĀ®. cial-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092 [[alternative HTML version deleted]] __ R-help@r-project.org 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] hi... problems about adjacency matrix
Dear all, Hi, I have the problems about converting the matrix to adjacency matrix.Here's my example, ab cd e fa 1.000 0.4048823682 0.1228531 0.49046991 0.4945158868 0.307443317b 0.4048824 1.00 0.4367475 0.96949219 0.0007378596 0.560747765c 0.1228531 0.4367474719 1.000 0.40037341 0.3157538204 0.428183667d 0.4904699 0.9694921891 0.4003734 1. 0.0661313658 0.575606129e 0.4945159 0.0007378596 0.3157538 0.06613137 1.00 0.001076251f 0.3074433 0.5607477645 0.4281837 0.57560613 0.0010762514 1.0 and my threshold value is 0.4763, which means any value above it is "1" and any values below it is "0". so my adjacency matrix should be like this, a b c d e fa 1 0 0 1 1 0b 0 1 0 1 0 1c 0 0 1 0 0 0d 1 1 0 1 0 1e 1 0 0 0 1 0f0 1 0 1 0 1 I'd like to ask how to convert the matrix to adjacency matrix. Thanks!!! Gina _ Hotmail: Powerful Free email with security by Microsoft. [[alternative HTML version deleted]] __ R-help@r-project.org 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.