Re: [R] reading files with name columns and row columns

2015-09-02 Thread shawin
dear William , I have an issue with R code which is : FCP<-as.matrix(sapply(FCPval,as.numeric)) for (i in 1:rowN){if (FCP$FC[i] >= 1.5 & FCP$FC[i]<=-1.5 & FCP$p[i]<=0.05){ dfrmPFC=data.frame(matrix(Fc=FC,p=p))} } the error is :Error in FCP$FC : $ operator is invalid for atomic vectors could you

Re: [R] reading files with name columns and row columns

2015-09-02 Thread shawin
also the header =0 On Wed, Sep 2, 2015 at 11:52 PM, Shawin Karim wrote: > make row.name=0 instead to 1 > > On Wed, Sep 2, 2015 at 11:07 PM, Bogdan Tanasa [via R] < > ml-node+s789695n4711774...@n4.nabble.com> wrote: > >> Dear all, >> >> would appreciate a piece of help with a simple question: I a

Re: [R] reading files with name columns and row columns

2015-09-02 Thread Bogdan Tanasa
that is great, thank you Bill for time and help ;) ! On Wed, Sep 2, 2015 at 4:36 PM, William Dunlap wrote: > y <- as.matrix(read.table("FILE_NAME",header=T,row.names=1)) > colnames(y) <- gsub("X","", colnames(y)) > > Use read.table's check.names=FALSE argument so it won't mangle > the column

Re: [R] reading files with name columns and row columns

2015-09-02 Thread William Dunlap
y <- as.matrix(read.table("FILE_NAME",header=T,row.names=1)) colnames(y) <- gsub("X","", colnames(y)) Use read.table's check.names=FALSE argument so it won't mangle the column names instead of trying to demangle them with gsub() afterwards. E.g., txt <- " 50% 100%\nA 5 8\nB 13

Re: [R] reading files with name columns and row columns

2015-09-02 Thread Bogdan Tanasa
Thanks, Bert ! I solved the situation in the meanwhile, by using : y <- as.matrix(read.table("FILE_NAME",header=T,row.names=1)) colnames(y) <- gsub("X","", colnames(y)) On Wed, Sep 2, 2015 at 3:59 PM, Bert Gunter wrote: > Please read the Help file carefully before posting: > > "read.table is

Re: [R] reading files with name columns and row columns

2015-09-02 Thread Bert Gunter
Please read the Help file carefully before posting: "read.table is not the right tool for reading large matrices, especially those with many columns: it is designed to read data frames which may have columns of very different classes. Use scan instead for matrices." But the answer to your questio

[R] reading files with name columns and row columns

2015-09-02 Thread Bogdan Tanasa
Dear all, would appreciate a piece of help with a simple question: I am reading in R a file that is formatted as a matrix (an example is shown below, although it is more complex, a matrix of 1000 * 1000 ): the names of the columns are 0, 1, 4, 8, etc the names of the rows are 0, 1

Re: [R] reading files

2013-09-04 Thread anupam sinha
#2 A_hubs_B_hubs 0.1388408 > #3A_hubs_B_nonhubs 0.1531984 > #4A_nonhubs_B_hubs 0.7910863 > #5 A_nonhubs_B_nonhubs 0.4926012 > #6B_hubs_B_nonhubs 0.6350055 > > A.K. > > > > - Original Message - > From: anupam sinha > To: r-help@r-project.o

Re: [R] reading files

2013-09-03 Thread arun
   NAME   P_value #1    A_hubs_A_nonhubs 0.3684845 #2   A_hubs_B_hubs 0.1388408 #3    A_hubs_B_nonhubs 0.1531984 #4    A_nonhubs_B_hubs 0.7910863 #5 A_nonhubs_B_nonhubs 0.4926012 #6    B_hubs_B_nonhubs 0.6350055 A.K. - Original Message - From: anupam sinha To: r-help@r-proj

[R] reading files

2013-09-03 Thread anupam sinha
Dear all, I need help with some coding. I have a directory with files like these: A_hubs A_nonhubs B_hubs B_nonhubs : : Each of these files have the following header and content: GENE TIS_DEG TOT_SVTIS_SVTIS_DISO ensg1 20 12 4 40 . . and so on..

Re: [R] reading files from two folders

2012-03-28 Thread uday
Hi Hth -- Gerrit , thanks for reply sorry it was typo mistake , but I corrected that problem before . But the error is still same. setwd("/Groups/data_first/") file_was <- list.files(path = ".", pattern = "v2.0.2.was", all.files = FALSE, full.names = FALSE, recursive = FALSE, ignore.case =

Re: [R] reading files from two folders

2012-03-28 Thread uday
Hi Hth -- Gerrit , I found the problem I added "sep" and one bracket was missing the new codes are as follows setwd("/Groups/data_first/") file_was <- list.files(path = ".", pattern = "v2.0.2.was", all.files = FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE) path<-c("

Re: [R] reading files from two folders

2012-03-28 Thread Roland Rau
Hi, On 03/28/2012 08:48 AM, uday wrote: > I would like to read data from two different folder and then combine this > together > the code which I have tried are as follows > setwd("/Groups/data_first/") > file_was <- list.files(path = ".", pattern = "v2.0.2.was", all.files = > FALSE, full.names

Re: [R] reading files from two folders

2012-03-28 Thread Gerrit Eichner
Hello, uday, there's presumably a typo in your code because you use path1t in data2 <- read.table(paste(path1t, file_wasaux2[i],header=TRUE)) and not path which you defined above. Hth -- Gerrit - Dr. Gerrit Eichner

[R] reading files from two folders

2012-03-28 Thread uday
I would like to read data from two different folder and then combine this together the code which I have tried are as follows setwd("/Groups/data_first/") file_was <- list.files(path = ".", pattern = "v2.0.2.was", all.files = FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE) path

Re: [R] Reading files with varying number of columns

2010-07-18 Thread Tim Clark
  - Original Message From: Uwe Ligges To: Tim Clark Cc: r-help@r-project.org Sent: Sun, July 18, 2010 6:03:47 AM Subject: Re: [R] Reading files with varying number of columns See argument "fill" in ?read.table Uwe Ligges On 18.07.2010 12:14, Tim Clark wrote: > De

Re: [R] Reading files with varying number of columns

2010-07-18 Thread Uwe Ligges
See argument "fill" in ?read.table Uwe Ligges On 18.07.2010 12:14, Tim Clark wrote: Dear R list, I am trying to read files with a varying number of columns and can't figure out how to get them in the proper format. Some rows have five value and some have seven. Is there a way to read them in

[R] Reading files with varying number of columns

2010-07-18 Thread Tim Clark
Dear R list, I am trying to read files with a varying number of columns and can't figure out how to get them in the proper format.  Some rows have five value and some have seven.  Is there a way to read them in so that two empty columns are added to every row that has only five values?  An examp

Re: [R] Reading files

2009-04-25 Thread David Winsemius
On Apr 25, 2009, at 2:46 AM, Santosh wrote: Dear R-sians Quick question... 1) From a flat (data) file with 100+ columns, how do I read specific columns instead of reading the entire dataset? I am trying to avoid reading the entire file followed by "subsetting". If you are asking about h

Re: [R] Reading files

2009-04-25 Thread jim holtman
On Sat, Apr 25, 2009 at 2:46 AM, Santosh wrote: > Dear R-sians > Quick question... > > 1) From a flat (data) file with 100+ columns, how do I read specific columns > instead of reading the entire dataset? I am trying to avoid reading the > entire file followed by "subsetting". In read.table you c

[R] Reading files

2009-04-25 Thread Santosh
Dear R-sians Quick question... 1) From a flat (data) file with 100+ columns, how do I read specific columns instead of reading the entire dataset? I am trying to avoid reading the entire file followed by "subsetting". 2) is the a way to a call a column of dataframe through a variable.. e.g. e,g

[R] reading files (readOGR) and non-ascii characters

2008-12-04 Thread Agustin Lobo
I'm forwarding to this list as I've got no answer in [R-sig-Geo] and perhaps this issue is not exclusive of readOGR() I'm using ubuntu 8.04 andR version 2.8.0 (2008-10-20) Original Message Subject: readOGR and non-ascii characters Date: Wed, 03 Dec 2008 14:22:34 +0100 From: Ag