jpm miao
2013-Apr-18 07:46 UTC
[R] How can I ask R to skip the title when reading the data?
I have many xls grade report sheets with the same format XXX High School Grade Report Confidential Yes Math English Science John 90 85 90 Mary 75 88 93 …… Since the reports are prepared on a regular basis, I have many reports with identical format. Without the title “XXX High School Grade Report Confidential Yes”, I can just change the xls to csv and read them via read.csv. How can I read the data in the presence of the title? How can I ask R to skip the title and just read the data? Thanks, Miao [[alternative HTML version deleted]]
andrija djurovic
2013-Apr-18 08:03 UTC
[R] How can I ask R to skip the title when reading the data?
Hi. You can try with argument skip in read.csv function(check ?read.csv). Also, if you want directly to import an Excel file you can use readWorksheet function from XLConnect package and use argument startRow to set up the first row to read from. Hope this helps. Andrija On Thu, Apr 18, 2013 at 9:46 AM, jpm miao <miaojpm@gmail.com> wrote:> I have many xls grade report sheets with the same format > > > > XXX High School Grade Report > > Confidential Yes > > > > Math English Science > > John 90 85 90 > > Mary 75 88 93 > > …… > > > > Since the reports are prepared on a regular basis, I have many reports with > identical format. Without the title “XXX High School Grade Report > > Confidential Yes”, I can just change the xls to csv and read them via > read.csv. How can I read the data in the presence of the title? How can I > ask R to skip the title and just read the data? > > > > Thanks, > > > > Miao > > [[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. > >[[alternative HTML version deleted]]
Pascal Oettli
2013-Apr-18 08:08 UTC
[R] How can I ask R to skip the title when reading the data?
Hi, You didn't read the help file carefully enough. ?read.csv "skip" argument. Regards, Pascal On 04/18/2013 04:46 PM, jpm miao wrote:> I have many xls grade report sheets with the same format > > > > XXX High School Grade Report > > Confidential Yes > > > > Math English Science > > John 90 85 90 > > Mary 75 88 93 > > ?? > > > > Since the reports are prepared on a regular basis, I have many reports with > identical format. Without the title ?XXX High School Grade Report > > Confidential Yes?, I can just change the xls to csv and read them via > read.csv. How can I read the data in the presence of the title? How can I > ask R to skip the title and just read the data? > > > > Thanks, > > > > Miao > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-help at 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. >
Possibly Parallel Threads
- Problems with reading data by readWorksheetFromFile of XLConnect Package
- Reading data from Excel file in r
- Questions on function "readNamedRegionFromFile" in XLConnect pacakge
- Input and output of time series data - any function or packages that helps?
- How can I access the title of a table read via read.csv?