Re: [R] how to read data

2014-01-29 Thread William Dunlap
e path. Bill Dunlap TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Vortex > Sent: Wednesday, January 29, 2014 9:22 AM > To: r-help@r-project.org > Subject: Re: [R] how to

Re: [R] how to read data

2014-01-29 Thread Vortex
chke1993 wrote > I don't know the meaning of sep="",and don't know where to add the > location of the file such as E//... sep="" means the data you are reading is separated by a white/blank space. sep="," would mean it is separated by a comma (,). If the file is located in your working direct

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Ista Zahn
I don't think you need admin rights to install R packages. Did you try it? Best, Ista On Wed, Sep 11, 2013 at 9:01 AM, Charles Thuo wrote: > how can one read data from MSEXcel into R especially in a case where one > does not have administrator rights to install additional packages. In short > ho

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Gabor Grothendieck
On Wed, Sep 11, 2013 at 9:06 AM, Charles Determan Jr wrote: > If there isn't multiple sheets you can use the 'gdata' package and > read.xls(). > > Otherwise you could re-save the file as a csv file and load that file with > read.csv() assuming not multiple sheets again which a csv cannot contain.

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Jeff Newmiller
The assertion that you need administrator privileges to install packages is false. You can install them into a directory under your Documents directory for your own use. You only need a administrator privileges to modify the packages located in the software installation directory. --

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Charles Determan Jr
If there isn't multiple sheets you can use the 'gdata' package and read.xls(). Otherwise you could re-save the file as a csv file and load that file with read.csv() assuming not multiple sheets again which a csv cannot contain. Regards, Charles On Wed, Sep 11, 2013 at 8:01 AM, Charles Thuo wro

[R] how to read data from MSExcel into R

2013-09-11 Thread Charles Thuo
how can one read data from MSEXcel into R especially in a case where one does not have administrator rights to install additional packages. In short how to read data from MSExcel into R with base packages only. [[alternative HTML version deleted]] _

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
Then read in a million lines, scan back for the break, write out the data, delete from the buffer, then read the next million lines into the buffer. On Tuesday, October 18, 2011, johannes rara wrote: > Thank you Jim for your kind reply. My intention was to split one 14M > file into less than 15 t

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
Thank you Jim for your kind reply. My intention was to split one 14M file into less than 15 text files, each of them having ~1M lines. The idea was to make sure that one "sequence" GG!KK!KK! --sequence start APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!K

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
I thought that you wanted a separate file for each of the breaks "GG!KK!KK!". If you want to read in some large number of lines and then break them so that they have that many lines, you can do the same thing, except scanning from the back for a break. So if your input file has 14M breaks in it,

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
Thanks Jim for your help. I tried this code using readLines and it works but not in way I wanted. It seems that this code is trying to separate all records from a text file so that I'm getting over 14 000 000 text files. My intention is to get only 15 text files all expect one containing 1 000 000

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
Use 'readLines' instead of 'read.table'. We want to read in the text file and convert it into separate text files, each of which can then be read in using 'read.table'. My solution assumes that you have used readLines. Trying to do this with data frames gets messy. Keep it simple and do it in t

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
Thanks Jim, I tried to convert this solution into my situation (.txt file as an input); zz <- file("myfile.txt", "r") fileNo <- 1 # used for file name buffer <- NULL repeat{ input <- read.csv(zz, as.is=T, nrows=100, sep='!', row.names=NULL, na.strings="") if (length(input) == 0) break

Re: [R] How to read data sequentially into R (line by line)?

2011-10-18 Thread jim holtman
Let's do it in two parts: first create all the separate files (which if this what you are after, we can stop here). You can change the value on readLines to read in as many lines as you want; I set it to 2 just for testing. x <- textConnection("APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!1

[R] How to read data sequentially into R (line by line)?

2011-10-18 Thread johannes rara
I have a data set like this in one .txt file (cols separated by !): APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!

Re: [R] How to read data from this csv?

2010-06-18 Thread Peter Ehlers
On 2010-06-18 23:22, YI LIU wrote: I am so frustrated about reading data from this sample csv file. My code is : test=read.csv(file='test.csv',header=T) warning message: In read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeade

[R] How to read data from this csv?

2010-06-18 Thread YI LIU
I am so frustrated about reading data from this sample csv file. My code is : >test=read.csv(file='test.csv',header=T) warning message: In read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'test.csv' >test [1] ÐÏ.à.. <0 ro

Re: [R] how to read data from the different worksheets in the same Excel file

2009-01-14 Thread Prof Brian Ripley
On Wed, 14 Jan 2009, Tony Breyal wrote: Hi Xin, I think you can use the read.xls() function from package xlsReadWrite. Assuming this is Windows alternatively, i think the odbcConnectExcel() function in package RODBC might work too (not sure about excel 2007 files, though there might be

Re: [R] how to read data from the different worksheets in the same Excel file

2009-01-14 Thread Tony Breyal
Hi Xin, I think you can use the read.xls() function from package xlsReadWrite. alternatively, i think the odbcConnectExcel() function in package RODBC might work too (not sure about excel 2007 files, though there might be an updated function for those types of files in the package). Hope that he

Re: [R] how to read data from the different worksheets in the same Excel file

2009-01-14 Thread Gabor Grothendieck
The read.xls function the gdata package has a sheet= argument. On Wed, Jan 14, 2009 at 6:30 AM, Xin Shi wrote: > Dear All: > > > > I am trying to read the data from the different sheet but in the same Excel > file. Does R provide this kind of command to do it? > > > > Anyone has experience on thi

[R] how to read data from the different worksheets in the same Excel file

2009-01-14 Thread Xin Shi
Dear All: I am trying to read the data from the different sheet but in the same Excel file. Does R provide this kind of command to do it? Anyone has experience on this? Thanks! Xin [[alternative HTML version deleted]] __ R

Re: [R] how to read data from table based a condition

2008-04-10 Thread Uwe Ligges
Marc Moragues wrote: > > Xin hotmail.com> writes: > > >> y<-data[,7] >> x<-data[,3] >> >> I want to know the mean of y if corresponding x=1. >> > > Try this: > > mean(data[data[,3]==1,data[,7]) Folks, please! 1. If you answer, please write at least syntactically valid code (look at your

Re: [R] how to read data from table based a condition

2008-04-10 Thread Uwe Ligges
Xin wrote: > Dear All: > > I imported a table into R. But I want to read a variable (y) from this > table conditional on another variable (x=1) in the table. > > y<-data[,7] > x<-data[,3] > > I want to know the mean of y if corresponding x=1. > > I tried > > if (x==1) y3<-y > > It do

Re: [R] how to read data from table based a condition

2008-04-10 Thread Marc Moragues
Xin hotmail.com> writes: > > y<-data[,7] > x<-data[,3] > > I want to know the mean of y if corresponding x=1. > Try this: mean(data[data[,3]==1,data[,7]) You can also look at ?subset. __ R-help@r-project.org mailing list https://stat.ethz.ch/m

[R] how to read data from table based a condition

2008-04-10 Thread Xin
Dear All: I imported a table into R. But I want to read a variable (y) from this table conditional on another variable (x=1) in the table. y<-data[,7] x<-data[,3] I want to know the mean of y if corresponding x=1. I tried if (x==1) y3<-y It does not work. Anyone can give a help? Than