Thread: [R-gregmisc-users] SF.net SVN: r-gregmisc:[1402] trunk/gdata/man/read.xls.Rd
Brought to you by:
warnes
From: <wa...@us...> - 2010-01-24 18:17:32
|
Revision: 1402 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1402&view=rev Author: warnes Date: 2010-01-24 18:17:26 +0000 (Sun, 24 Jan 2010) Log Message: ----------- Fix typo Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2010-01-24 18:10:03 UTC (rev 1401) +++ trunk/gdata/man/read.xls.Rd 2010-01-24 18:17:26 UTC (rev 1402) @@ -27,8 +27,8 @@ \item{perl}{name of the perl executable to be called.} \item{method}{intermediate file format, "csv" for comma-separated and "tab" for tab-separated} - \item{...}{additional arguments to read.table. The defaults of - read.csv are used.} + \item{...}{additional arguments to read.table. The defaults for + read.csv() are used.} } \value{ \code{"read.xls"} returns a data frame. @@ -54,7 +54,7 @@ \note{ Either a working version of Perl must be present in the executable search path, or the exact path of the perl executable must be provided via the \code{perl} argument. See the examples below for an illustration.} -\seealso{ \code{\link[base]{read.csv}} } +\seealso{ \code{\link[utils]{read.csv}} } \examples{ # iris.xls is included in the gregmisc package for use as an example This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ggr...@us...> - 2010-07-07 22:48:22
|
Revision: 1447 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1447&view=rev Author: ggrothendieck2 Date: 2010-07-07 22:48:16 +0000 (Wed, 07 Jul 2010) Log Message: ----------- small improvements to read.xls.Rd Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2010-06-11 03:29:12 UTC (rev 1446) +++ trunk/gdata/man/read.xls.Rd 2010-07-07 22:48:16 UTC (rev 1447) @@ -47,6 +47,11 @@ \code{read.table} since the first character of all lines (including comment lines) will be "\"" after conversion. + If you have quotes in your data which confuse the process you may wish to use + \code{read.xls(..., quote = '')}. This will cause the quotes to be regarded + as data and you will have to then handle the quotes yourself after reading + the file in. + Caution: If you call \code{"xls2csv"} directly, is your responsibility to close and delete the file after using it. } @@ -85,6 +90,11 @@ # Example specifying exact Perl path for Unix systems iris <- read.xls(xlsfile, perl="/usr/bin/perl") + # finding perl + # (read.xls automatically calls findPerl so this is rarely needed) + perl <- gdata:::findPerl("perl") + iris <- read.xls(xlsfile, perl=perl) + # read xls file from net nba.url <- "http://mgtclass.mgt.unm.edu/Bose/Excel/Tutorial.05/Cases/NBA.xls" nba <- read.xls(nba.url) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2011-09-20 18:08:17
|
Revision: 1508 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1508&view=rev Author: warnes Date: 2011-09-20 18:08:08 +0000 (Tue, 20 Sep 2011) Log Message: ----------- Improve xls2csv() man page Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2011-09-20 18:07:45 UTC (rev 1507) +++ trunk/gdata/man/read.xls.Rd 2011-09-20 18:08:08 UTC (rev 1508) @@ -18,8 +18,7 @@ \arguments{ \item{xls}{path to the Microsoft Excel file. Supports "http://", "https://", and "ftp://" URLS.} - \item{sheet}{number of the sheet within the Excel file from which data - are to be read} + \item{sheet}{name or number of the worksheet to read} \item{verbose}{logical flag indicating whether details should be printed as the file is processed.} \item{pattern}{if specified, them skip all lines before the first @@ -86,7 +85,9 @@ # Example specifying exact Perl path for default MS-Windows install of # ActiveState perl iris <- read.xls(xlsfile, perl="C:/perl/bin/perl.exe") + } + \dontrun{ # Example specifying exact Perl path for Unix systems iris <- read.xls(xlsfile, perl="/usr/bin/perl") @@ -94,11 +95,15 @@ # (read.xls automatically calls findPerl so this is rarely needed) perl <- gdata:::findPerl("perl") iris <- read.xls(xlsfile, perl=perl) + } + \dontrun{ # read xls file from net nba.url <- "http://mgtclass.mgt.unm.edu/Bose/Excel/Tutorial.05/Cases/NBA.xls" nba <- read.xls(nba.url) + } + /dontrun{ # read xls file ignoring all lines prior to first containing State crime.url <- "http://www.jrsainfo.org/jabg/state_data2/Tribal_Data00.xls" crime <- read.xls(crime.url, pattern = "State") @@ -107,7 +112,6 @@ con <- xls2csv(crime.url) print(readLines(con, 2)) file.remove(summary(con)$description) - } # Examples demonstrating selection of specific 'sheets' @@ -119,9 +123,14 @@ # see the number and names of sheets: sheetCount(exampleFile) + if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + sheetCount(exampleFile2007) + + # show names of shets in the file + sheetNames(exampleFile) if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. - sheetNames(exampleFile2007) + sheetNames(exampleFile2007) data <- read.xls(exampleFile) # default is first worksheet data <- read.xls(exampleFile, sheet=2) # second worksheet by number This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2011-10-05 15:32:01
|
Revision: 1516 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1516&view=rev Author: warnes Date: 2011-10-05 15:31:55 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Fix typo Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2011-09-30 19:09:53 UTC (rev 1515) +++ trunk/gdata/man/read.xls.Rd 2011-10-05 15:31:55 UTC (rev 1516) @@ -103,7 +103,7 @@ nba <- read.xls(nba.url) } - /dontrun{ + \dontrun{ # read xls file ignoring all lines prior to first containing State crime.url <- "http://www.jrsainfo.org/jabg/state_data2/Tribal_Data00.xls" crime <- read.xls(crime.url, pattern = "State") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2012-06-06 01:26:01
|
Revision: 1542 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1542&view=rev Author: warnes Date: 2012-06-06 01:25:55 +0000 (Wed, 06 Jun 2012) Log Message: ----------- Replace non-ASCII characters. Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2012-06-06 01:21:44 UTC (rev 1541) +++ trunk/gdata/man/read.xls.Rd 2012-06-06 01:25:55 UTC (rev 1542) @@ -27,7 +27,7 @@ \item{method}{intermediate file format, "csv" for comma-separated and "tab" for tab-separated} \item{na.strings}{a character vector of strings which are to be interpreted - as ‘NA’ values. See \code{\link[utils]{read.table}} for details.} + as 'NA' values. See \code{\link[utils]{read.table}} for details.} \item{...}{additional arguments to read.table. The defaults for read.csv() are used.} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2012-08-22 16:42:54
|
Revision: 1600 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1600&view=rev Author: warnes Date: 2012-08-22 16:42:48 +0000 (Wed, 22 Aug 2012) Log Message: ----------- Add example for read.xls() that shows how to use the fileEncoding argument to read in latin-1 encoded data. Modified Paths: -------------- trunk/gdata/man/read.xls.Rd Modified: trunk/gdata/man/read.xls.Rd =================================================================== --- trunk/gdata/man/read.xls.Rd 2012-08-22 16:41:30 UTC (rev 1599) +++ trunk/gdata/man/read.xls.Rd 2012-08-22 16:42:48 UTC (rev 1600) @@ -87,64 +87,71 @@ \dontrun{ - # Example specifying exact Perl path for default MS-Windows install of - # ActiveState perl + ## Example specifying exact Perl path for default MS-Windows install of + ## ActiveState perl iris <- read.xls(xlsfile, perl="C:/perl/bin/perl.exe") } \dontrun{ - # Example specifying exact Perl path for Unix systems + ## Example specifying exact Perl path for Unix systems iris <- read.xls(xlsfile, perl="/usr/bin/perl") - # finding perl - # (read.xls automatically calls findPerl so this is rarely needed) + ## finding perl + ## (read.xls automatically calls findPerl so this is rarely needed) perl <- gdata:::findPerl("perl") iris <- read.xls(xlsfile, perl=perl) } \dontrun{ - # read xls file from net + ## read xls file from net nba.url <- "http://mgtclass.mgt.unm.edu/Bose/Excel/Tutorial.05/Cases/NBA.xls" nba <- read.xls(nba.url) } \dontrun{ - # read xls file ignoring all lines prior to first containing State + ## read xls file ignoring all lines prior to first containing State crime.url <- "http://www.jrsainfo.org/jabg/state_data2/Tribal_Data00.xls" crime <- read.xls(crime.url, pattern = "State") - # use of xls2csv - open con, print two lines, close con + ## use of xls2csv - open con, print two lines, close con con <- xls2csv(crime.url) print(readLines(con, 2)) file.remove(summary(con)$description) } - # Examples demonstrating selection of specific 'sheets' - # from the example XLS file 'ExampleExcelFile.xls' + ## Examples demonstrating selection of specific 'sheets' + ## from the example XLS file 'ExampleExcelFile.xls' exampleFile <- file.path(.path.package('gdata'),'xls', 'ExampleExcelFile.xls') exampleFile2007 <- file.path(.path.package('gdata'),'xls', 'ExampleExcelFile.xlsx') - # see the number and names of sheets: + ## see the number and names of sheets: sheetCount(exampleFile) - if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + if( 'XLSX' \%in\% xlsFormats() ) ## if XLSX is supported.. sheetCount(exampleFile2007) - # show names of shets in the file + ## show names of shets in the file sheetNames(exampleFile) - if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + if( 'XLSX' \%in\% xlsFormats() ) ## if XLSX is supported.. sheetNames(exampleFile2007) - data <- read.xls(exampleFile) # default is first worksheet - data <- read.xls(exampleFile, sheet=2) # second worksheet by number - data <- read.xls(exampleFile, sheet="Sheet Second",v=TRUE) # and by name + data <- read.xls(exampleFile) ## default is first worksheet + data <- read.xls(exampleFile, sheet=2) ## second worksheet by number + data <- read.xls(exampleFile, sheet="Sheet Second",v=TRUE) ## and by name - # load the third worksheet, skipping the first two non-data lines... - if( 'XLSX' \%in\% xlsFormats() ) # if XLSX is supported.. + ## load the third worksheet, skipping the first two non-data lines... + if( 'XLSX' \%in\% xlsFormats() ) ## if XLSX is supported.. data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) + ## load a file containing data and column names using latin-1 + ## characters + latinFile <- file.path(.path.package('gdata'),'xls','latin-1.xls') + latin1 <- read.xls(latinFile, fileEncoding="latin1") + colnames(latin1) + + } \author{ Gregory R. Warnes \email{gr...@wa...}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |