Re: [R] Merge several datasets into one

2016-07-01 Thread Lida Zeighami
Hi Lily, I think below codes can work: f<- list.files("D:/output/test/your folde rname",full.names=TRUE,recursive=TRUE) files<- grep(".csv", f) files_merge<- data.frame() for (i in 1:length(f[files])){ data<- read.csv(file=f[files][i],header=TRUE, sep=",") files_merge<-

[R] replace NAs in each column of a matrix with 0 or 1 or 2 with specific proportion

2016-06-06 Thread Lida Zeighami
Hello specialist, I have a matrix in which there are NA,0,1 and 2 in each columns. I wanna replace NAs with special proportion of 0,1 or 2 ! for example in df<- matric(df, nrow=50, ncol=100) If in one column the number of NAs = 10 , # of 0=50 , #of 1=25 and # of 2=15 I want to replace 5 of 10

[R] couldn't install pcalg package in R 3.1.3

2016-05-27 Thread Lida Zeighami
Hi Dears! Would you please let me know how I can install package pcalg for R version 3.1.3 ? I've tried different ways but got error! Thanks inadvance! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To

Re: [R] find high correlated variables in a big matrix

2016-05-10 Thread Lida Zeighami
Winsemius <dwinsem...@comcast.net> wrote: > > > On May 6, 2016, at 2:12 PM, Lida Zeighami <lid.z...@gmail.com> wrote: > > > > Hi there, > > > > Is there any way to find out high correlated variables among a big > matrix? > > for example I h

[R] find high correlated variables in a big matrix

2016-05-06 Thread Lida Zeighami
Hi there, Is there any way to find out high correlated variables among a big matrix? for example I have a matrix called data= 2000*5000 and I need to find the high correlated variables between the variables in the columns! (Need 100 high correlated variables from 5000 variables in column) I

Re: [R] How to reach the column names in a huge .RData file without loading it

2016-03-19 Thread Lida Zeighami
gt; -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Wed, Mar 16, 2016 at 8:59 AM, Lida Zeighami <lid.z...@gmail.com> wrote: > > Hi, > > I have a huge .RData file and I need just to get the colnames of it. so > is > > there any wa

[R] How to reach the column names in a huge .RData file without loading it

2016-03-19 Thread Lida Zeighami
Hi, I have a huge .RData file and I need just to get the colnames of it. so is there any way to reach the column names without loading or reading the whole file? Since the file is so big and I need to repeat this process several times, so it takes so long to load the file first and then take the

[R] question about categorical variables in R

2015-09-11 Thread Lida Zeighami
Hi dear experts, I have a general question in R, about the categorical variable such as Gender(Male or Female) If I have this column in my data and wanted to do regression model or feed the data to seqmeta packages (singlesnp, skat meta) , would you please let me know should I code them first (

[R] intersection between two matrices based on two columns in R

2015-09-09 Thread Lida Zeighami
Hi there, I want to find the intersection between two different data frame or matrices based on two columns. for example in matrix A I have 5 columns, the first two columns are Id1 and Id2 and I have the same columns in the other matrix B, (Id1, Id2 ,,,) how can I find the intersection between

Re: [R] add an idx column to the matrix

2015-08-13 Thread Lida Zeighami
causing error and a code you hardly get any sensible advice. Cheers Petr *From:* Lida Zeighami [mailto:lid.z...@gmail.com] *Sent:* Wednesday, August 12, 2015 6:23 PM *To:* PIKAL Petr *Subject:* Re: [R] add an idx column to the matrix Dear Petr, I use your code in a loop function

Re: [R] add an idx column to the matrix

2015-08-12 Thread Lida Zeighami
Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thierry Onkelinx Sent: Monday, August 10, 2015 10:29 PM To: Lida Zeighami Cc: r-help@r-project.org Subject: Re: [R] add an idx column to the matrix Dear Lida, Here is a solution. Please don't post in HTML

Re: [R] add an idx column to the matrix

2015-08-12 Thread Lida Zeighami
mydata X125 X255 X558 X2366 X177 X255.1 idx aa010NA0 0 0 bb110NA0 1 0 cs212 1 0 0 1 de010NA0 0 0 gh200 0 0 0 1 Sarah On Mon, Aug 10, 2015 at 4:11 PM, Lida

Re: [R] add an idx column to the matrix

2015-08-12 Thread Lida Zeighami
Goslee sarah.gos...@gmail.com wrote: On Wed, Aug 12, 2015 at 2:04 PM, Lida Zeighami lid.z...@gmail.com wrote: I applied this code in a loop function but since in some matrices there isn't any 2, so I got the below error: idx- apply(lofGT_met,1, function(x)as.numeric(any(x==2 !is.na(x

[R] add an idx column to the matrix

2015-08-10 Thread Lida Zeighami
Hi there, I have a matrix contain 0,1,2, NA elements. I want to add a column to this matrix with name of idx . then for each row, I should put 1 in this column (idx) if there is at least one 2 in that row otherwise I should put 0 in this column! for example mydata: 125 255 558

Re: [R] Reading some csv files from different folders and add the name of each files to the first column of files

2015-07-27 Thread Lida Zeighami
. Hope this help ! Arnaud ### Date: Sat, 25 Jul 2015 15:03:21 -0500 From: Lida Zeighami lid.z...@gmail.com To: r-help@r-project.org Subject: [R] Reading some csv files from different folders and add the name of each

[R] Reading some csv files from different folders and add the name of each files to the first column of files

2015-07-25 Thread Lida Zeighami
I have 600 folders in which there are 3 csv files. The name of folders are as follows: EA_aa, EA_bb, EA_cc, EA_dd, In each folder there are 3 csv files: in folder EA_aa there are: EA_sing_aa.csvqwerty EA_ska_aa.csv EA_tat_aa.csv In folder EA_bb: EA_sing_bb.csv EA_ska_bb.csv

[R] removing the columns with 0 or NA or 1or NA or 2 or NA

2015-07-16 Thread Lida Zeighami
I have ma matrix which its elements are NA,0,1,2 ! I got my answer bout removing the columns with 0 or NA or both values but now I want to add additional condition for deleting the columns! I have to delete the columns which contain the same value. delete the columns with NA or 0 or both and the

[R] remove 0 and NA values

2015-07-13 Thread Lida Zeighami
Hi there, I have a matrix which its elements are 0, 1,2,NA I want to remove the columns which the colsums are equal to 0 or NA and drop these columns from the original matrix and create the new matrix for the nonzero and NA value? (I think I have consider na.rm=True and remove the colums with

[R] select a subset of a matrix which one of its column meet a condition

2015-07-08 Thread Lida Zeighami
Hi there, I have a matrix and I want to get a subset from that which one of its matrix meet a condition, my matrix is met Row.names Name maf caf 1 10:13915 10:139 0.0003782148 0.0003782148 2 10:18738

[R] add a special column to a matrix

2015-07-07 Thread Lida Zeighami
Hi there, I have a two matrices which they have a common column! I want to add the a column of second to matrix to the equivalent column of first matrix! my first matrix is head(mat1) a b c d fg1:23 dfgv 5 pt10:18 tgtgh 1 wq 15:123oiljk

Re: [R] question

2015-07-06 Thread Lida Zeighami
. Box 760549 San Antonio, TX 78245-0549 Telephone: (210)258-9476 e-mail: msh...@txbiomed.org On Jul 2, 2015, at 11:48 AM, Lida Zeighami lid.z...@gmail.com wrote: Thank you so much for replying me! for better understanding my problem, I explain my problem more: I have a 682*1 matrix

Re: [R] question

2015-07-02 Thread Lida Zeighami
On Wed, Jul 1, 2015 at 1:07 PM, Lida Zeighami lid.z...@gmail.com wrote: I have 682 variables in a data frame , and a function that I should feed 682 variables in this function one by one and each time save the file as a special name! for emaple: my data frame file includes 682 names : 1 aaa

[R] question

2015-07-01 Thread Lida Zeighami
I have 682 variables in a data frame , and a function that I should feed 682 variables in this function one by one and each time save the file as a special name! for emaple: my data frame file includes 682 names : 1 aaa 2 bbb 3 dfdsfg 4 fghh . 682 fgfhg and a function like prep(Z, aaa, .)

[R] question

2015-06-26 Thread Lida Zeighami
Hi there, I have a matrix (n*m) which rows including 0,1,2 I want to know the frequency of each elements (0 , 1 , 2) separately for each row! for example : 123 456 7 A 0 1 10 222 B 1 1 1200 2 C 21 10 0