Import Debian changes 2.8.1-1
gdata (2.8.1-1) unstable; urgency=low
* New upstream release
* debian/control: Set (Build-)Depends: to current R version
* debian/control: Set Standards-Version: to current version
Dirk Eddelbuettel
5 years ago
0 | 2010-11-12 19:14 warnes | |
1 | ||
2 | * [r1462] inst/NEWS: Update NEWS for gdata 2.8.1 | |
3 | ||
4 | 2010-11-12 19:09 warnes | |
5 | ||
6 | * [r1461] DESCRIPTION: Update DEScription file for 2.8.1 release | |
7 | ||
8 | 2010-11-12 19:08 warnes | |
9 | ||
10 | * [r1460] tests/test.read.xls.Rout.save, | |
11 | tests/tests.write.fwf.Rout.save: Update test output to match | |
12 | latest code | |
13 | ||
14 | 2010-11-12 19:08 warnes | |
15 | ||
16 | * [r1459] R/write.fwf.R, man/write.fwf.Rd, | |
17 | tests/test.write.fwf.eol.R: Modify write.fwf() to capture and | |
18 | pass on additional arguments for | |
19 | write.table(). This resolves a bug reported by Jan Wijffels. | |
20 | ||
21 | 2010-11-01 00:30 arnima | |
22 | ||
23 | * [r1453] man/Args.Rd: Minor improvement in Args.Rd help page | |
24 | ||
25 | 2010-10-19 22:04 warnes | |
26 | ||
27 | * [r1452] R/onAttach.R, R/xls2sep.R: Avoid use of file.access() | |
28 | which is unreliable on Windows network shares. | |
29 | ||
30 | 2010-07-08 12:36 ggrothendieck2 | |
31 | ||
32 | * [r1448] R/xls2sep.R: findPerl call added to xls2sep | |
33 | ||
34 | 2010-07-07 22:48 ggrothendieck2 | |
35 | ||
36 | * [r1447] man/read.xls.Rd: small improvements to read.xls.Rd | |
37 | ||
38 | 2010-05-03 16:26 warnes | |
39 | ||
40 | * [r1439] NAMESPACE, R/installXLSXModules.R, | |
41 | R/installXLSXsupport.R, R/onAttach.R, inst/NEWS, | |
42 | man/installXLSXsupport.Rd, man/xlsFormats.Rd: Rename | |
43 | installXLSXModules() to installXLSXsupport() and provide | |
44 | documentation for it. | |
45 | ||
46 | 2010-05-03 13:48 warnes | |
47 | ||
48 | * [r1438] inst/NEWS: Update news for gdata 2.8.0 | |
49 | ||
0 | 50 | 2010-05-03 13:35 warnes |
1 | 51 | |
2 | 52 | * [r1437] DESCRIPTION, NAMESPACE, R/installXLSXModules.R, |
2 | 2 | Description: Various R programming tools for data manipulation |
3 | 3 | Depends: R (>= 2.6.0) |
4 | 4 | Imports: gtools |
5 | Version: 2.8.0 | |
6 | Date: 2010-04-03 | |
5 | Version: 2.8.1 | |
6 | Date: 2010-11-12 | |
7 | 7 | Author: Gregory R. Warnes, with contributions from Ben Bolker, Gregor |
8 | 8 | Gorjanc, Gabor Grothendieck, Ales Korosec, Thomas Lumley, Don |
9 | 9 | MacQueen, Arni Magnusson, Jim Rogers, and others |
10 | 10 | Maintainer: Gregory Warnes <greg@warnes.net> |
11 | 11 | License: GPL-2 |
12 | Packaged: 2010-05-03 16:26:31 UTC; warnes | |
12 | Packaged: 2010-11-12 19:20:23 UTC; warnes | |
13 | 13 | Repository: CRAN |
14 | Date/Publication: 2010-05-03 18:58:01 | |
14 | Date/Publication: 2010-11-13 15:19:27 |
0 | CHANGES IN 2.8.1 (2010-11-12) | |
1 | ----------------------------- | |
2 | ||
3 | Enhancements: | |
4 | ||
5 | - Minor improvement to Args(), read.xls() man page. | |
6 | ||
7 | Bug fixes: | |
8 | ||
9 | - Modify write.fwf() to capture and pass on additional arguments for | |
10 | write.table(). This resolves a bug reported by Jan Wijffels. | |
11 | ||
12 | - Modify xls2sep.R to avoid use of file.access() which is unreliable | |
13 | on Windows network shares. | |
14 | ||
15 | ||
0 | 16 | CHANGES IN 2.8.0 (2010-04-03) |
1 | 17 | ----------------------------- |
2 | 18 | |
14 | 30 | installXLSXsupport() function to attempt to install the necessary |
15 | 31 | perl libraries. |
16 | 32 | |
17 | - The function function installXLSXsupport() has been provided to | |
18 | install the binary perl modules that read.xls needs to support Excel | |
19 | 2007+ 'XLSX' files. | |
33 | - The function installXLSXsupport() has been provided to install the | |
34 | binary perl modules that read.xls needs to support Excel 2007+ | |
35 | 'XLSX' files. | |
20 | 36 | |
21 | 37 | |
22 | 38 | CHANGES IN 2.7.3 (2010-04-02) |
0 | 0 | .onAttach <- function(libname, pkgname) |
1 | 1 | { |
2 | 2 | show <- function(...) |
3 | writeLines(strwrap( x=list(...), prefix="gdata: " )) | |
4 | ||
3 | packageStartupMessage( | |
4 | paste( | |
5 | strwrap(x = list(...), | |
6 | prefix = "gdata: "), | |
7 | collapse="\n",sep="\n" | |
8 | ) | |
9 | ) | |
5 | 10 | |
6 | 11 | try( |
7 | 12 | { |
0 | 0 | ### write.fwf.R |
1 | 1 | ###------------------------------------------------------------------------ |
2 | 2 | ### What: Write fixed width format - code |
3 | ### $Id: write.fwf.R 1300 2008-08-05 11:47:18Z ggorjan $ | |
3 | ### $Id: write.fwf.R 1459 2010-11-12 19:08:12Z warnes $ | |
4 | 4 | ### Time-stamp: <2008-08-05 12:11:27 ggorjan> |
5 | 5 | ###------------------------------------------------------------------------ |
6 | 6 | |
7 | write.fwf <- function(x, file="", append=FALSE, quote=FALSE, sep=" ", | |
8 | na="", rownames=FALSE, colnames=TRUE, rowCol=NULL, | |
9 | justify="left", formatInfo=FALSE, quoteInfo=TRUE, | |
10 | width=NULL, ...) | |
7 | write.fwf <- function(x, | |
8 | file="", | |
9 | append=FALSE, | |
10 | quote=FALSE, | |
11 | sep=" ", | |
12 | na="", | |
13 | rownames=FALSE, | |
14 | colnames=TRUE, | |
15 | rowCol=NULL, | |
16 | justify="left", | |
17 | formatInfo=FALSE, | |
18 | quoteInfo=TRUE, | |
19 | width=NULL, | |
20 | eol="\n", | |
21 | qmethod=c("escape", "double"), | |
22 | ...) | |
11 | 23 | { |
12 | 24 | ## --- Setup --- |
13 | 25 | |
136 | 148 | |
137 | 149 | if(colnames) { |
138 | 150 | if(rownames && is.null(rowCol)) colnamesMy <- colnamesMy[-1] |
139 | write.table(t(as.matrix(colnamesMy)), file=file, append=append, | |
140 | quote=quote, sep=sep, row.names=FALSE, col.names=FALSE, ...) | |
141 | } | |
151 | write.table(t(as.matrix(colnamesMy)), | |
152 | file=file, | |
153 | append=append, | |
154 | quote=quote, | |
155 | sep=sep, | |
156 | eol=eol, | |
157 | na=na, | |
158 | row.names=FALSE, | |
159 | col.names=FALSE, | |
160 | qmethod=qmethod) | |
161 | } | |
142 | 162 | |
143 | write.table(x=x, file=file, append=(colnames || append), quote=quote, | |
144 | sep=sep, row.names=FALSE, col.names=FALSE, ...) | |
163 | write.table(x=x, | |
164 | file=file, | |
165 | append=(colnames || append), | |
166 | quote=quote, | |
167 | sep=sep, | |
168 | eol=eol, | |
169 | na=na, | |
170 | row.names=FALSE, | |
171 | col.names=FALSE, | |
172 | qmethod=qmethod) | |
145 | 173 | |
146 | 174 | ## --- Return format and fixed width information --- |
147 | 175 |
0 | ## s$Id: xls2sep.R 1418 2010-01-28 19:56:21Z warnes $ | |
0 | ## s$Id: xls2sep.R 1452 2010-10-19 22:04:49Z warnes $ | |
1 | 1 | |
2 | 2 | xls2csv <- function(xls, sheet=1, verbose=FALSE, ..., perl="perl") |
3 | 3 | xls2sep(xls=xls, sheet=sheet, verbose=verbose, ..., method="csv", |
12 | 12 | perl=perl) |
13 | 13 | |
14 | 14 | xls2sep <- function(xls, sheet=1, verbose=FALSE, ..., |
15 | method=c("csv","tsv","tab"), perl="perl") | |
15 | method=c("csv","tsv","tab"), perl = perl) | |
16 | 16 | { |
17 | 17 | |
18 | 18 | method <- match.arg(method) |
19 | 19 | |
20 | perl <- if (missing(perl)) | |
21 | findPerl(verbose = verbose) | |
22 | else | |
23 | findPerl(perl, verbose = verbose) | |
24 | ||
20 | 25 | ## |
21 | 26 | ## directories |
22 | 27 | package.dir <- .path.package('gdata') |
38 | 43 | if(verbose) cat("Done.\n") |
39 | 44 | xls <- tf |
40 | 45 | } |
41 | ||
42 | if(file.access(xls, 4)!=0) | |
43 | stop("Unable to read xls file '", xls, "'." ) | |
44 | 46 | |
45 | 47 | if(method=="csv") |
46 | 48 | { |
89 | 91 | ## |
90 | 92 | ## do the translation |
91 | 93 | if(verbose) cat("Executing '", cmd, "'... \n\n") |
94 | ||
95 | results <- try(system(cmd, intern=!verbose)) | |
96 | ||
97 | if(inherits(results, "try-error")) | |
98 | stop( "Unable to read xls file '", xls, "':", results ) | |
99 | ||
100 | if(verbose) cat(results,"\n\n") | |
101 | if (verbose) cat("Done.\n\n") | |
102 | ||
92 | 103 | ## |
93 | results <- system(cmd, intern=!verbose) | |
94 | if(verbose) cat(results,"\n\n") | |
104 | ## check that the target file was created | |
95 | 105 | ## |
96 | if (verbose) cat("Done.\n\n") | |
97 | ## | |
98 | ## | |
106 | if(!file.exists(targetFile)) | |
107 | stop( "Intermediate file '", targetFile, "' missing!" ) | |
99 | 108 | |
100 | if(file.access(targetFile, 4)!=0) | |
101 | stop("Unable to read translated ", method, " file '", targetFile, "'." ) | |
109 | ## Creae a file object to hand to the next stage.. | |
110 | retval <- try(file(targetFile)) | |
111 | if(inherits(retval, "try-error")) | |
112 | ||
113 | stop("Unable to open intermediate file '", targetFile, "':", | |
114 | retval) | |
102 | 115 | |
103 | if (verbose) cat("Done.\n") | |
104 | ||
116 | return(retval) | |
105 | 117 | |
106 | ## prepare for cleanup now, in case of error reading file | |
107 | file(targetFile) | |
108 | 118 | } |
109 | 119 |
0 | gdata (2.8.1-1) unstable; urgency=low | |
1 | ||
2 | * New upstream release | |
3 | ||
4 | * debian/control: Set (Build-)Depends: to current R version | |
5 | * debian/control: Set Standards-Version: to current version | |
6 | ||
7 | -- Dirk Eddelbuettel <edd@debian.org> Sat, 13 Nov 2010 14:36:59 -0600 | |
8 | ||
0 | 9 | gdata (2.8.0-1) unstable; urgency=low |
1 | 10 | |
2 | 11 | * New upstream release |
1 | 1 | Section: gnu-r |
2 | 2 | Priority: optional |
3 | 3 | Maintainer: Dirk Eddelbuettel <edd@debian.org> |
4 | Build-Depends: cdbs, debhelper (>> 5.0.0), r-base-dev (>= 2.11.0), r-cran-gtools | |
5 | Standards-Version: 3.8.4 | |
4 | Build-Depends: cdbs, debhelper (>= 7.0.0), r-base-dev (>= 2.12.0), r-cran-gtools | |
5 | Standards-Version: 3.9.1 | |
6 | 6 | |
7 | 7 | Package: r-cran-gdata |
8 | 8 | Architecture: any |
9 | Depends: ${shlibs:Depends}, r-base-core (>= 2.11.0), r-cran-gtools | |
9 | Depends: ${shlibs:Depends}, r-base-core (>= 2.12.0), r-cran-gtools | |
10 | 10 | Replaces: r-cran-gregmisc (<= 2.0.7-1) |
11 | 11 | Description: GNU R package with data manipulation tools by Greg Warnes et al |
12 | 12 | This package of R programming tools was written by Gregory Warnes |
0 | 2010-11-12 19:14 warnes | |
1 | ||
2 | * [r1462] inst/NEWS: Update NEWS for gdata 2.8.1 | |
3 | ||
4 | 2010-11-12 19:09 warnes | |
5 | ||
6 | * [r1461] DESCRIPTION: Update DEScription file for 2.8.1 release | |
7 | ||
8 | 2010-11-12 19:08 warnes | |
9 | ||
10 | * [r1460] tests/test.read.xls.Rout.save, | |
11 | tests/tests.write.fwf.Rout.save: Update test output to match | |
12 | latest code | |
13 | ||
14 | 2010-11-12 19:08 warnes | |
15 | ||
16 | * [r1459] R/write.fwf.R, man/write.fwf.Rd, | |
17 | tests/test.write.fwf.eol.R: Modify write.fwf() to capture and | |
18 | pass on additional arguments for | |
19 | write.table(). This resolves a bug reported by Jan Wijffels. | |
20 | ||
21 | 2010-11-01 00:30 arnima | |
22 | ||
23 | * [r1453] man/Args.Rd: Minor improvement in Args.Rd help page | |
24 | ||
25 | 2010-10-19 22:04 warnes | |
26 | ||
27 | * [r1452] R/onAttach.R, R/xls2sep.R: Avoid use of file.access() | |
28 | which is unreliable on Windows network shares. | |
29 | ||
30 | 2010-07-08 12:36 ggrothendieck2 | |
31 | ||
32 | * [r1448] R/xls2sep.R: findPerl call added to xls2sep | |
33 | ||
34 | 2010-07-07 22:48 ggrothendieck2 | |
35 | ||
36 | * [r1447] man/read.xls.Rd: small improvements to read.xls.Rd | |
37 | ||
38 | 2010-05-03 16:26 warnes | |
39 | ||
40 | * [r1439] NAMESPACE, R/installXLSXModules.R, | |
41 | R/installXLSXsupport.R, R/onAttach.R, inst/NEWS, | |
42 | man/installXLSXsupport.Rd, man/xlsFormats.Rd: Rename | |
43 | installXLSXModules() to installXLSXsupport() and provide | |
44 | documentation for it. | |
45 | ||
46 | 2010-05-03 13:48 warnes | |
47 | ||
48 | * [r1438] inst/NEWS: Update news for gdata 2.8.0 | |
49 | ||
0 | 50 | 2010-05-03 13:35 warnes |
1 | 51 | |
2 | 52 | * [r1437] DESCRIPTION, NAMESPACE, R/installXLSXModules.R, |
0 | CHANGES IN 2.8.1 (2010-11-12) | |
1 | ----------------------------- | |
2 | ||
3 | Enhancements: | |
4 | ||
5 | - Minor improvement to Args(), read.xls() man page. | |
6 | ||
7 | Bug fixes: | |
8 | ||
9 | - Modify write.fwf() to capture and pass on additional arguments for | |
10 | write.table(). This resolves a bug reported by Jan Wijffels. | |
11 | ||
12 | - Modify xls2sep.R to avoid use of file.access() which is unreliable | |
13 | on Windows network shares. | |
14 | ||
15 | ||
0 | 16 | CHANGES IN 2.8.0 (2010-04-03) |
1 | 17 | ----------------------------- |
2 | 18 | |
14 | 30 | installXLSXsupport() function to attempt to install the necessary |
15 | 31 | perl libraries. |
16 | 32 | |
17 | - The function function installXLSXsupport() has been provided to | |
18 | install the binary perl modules that read.xls needs to support Excel | |
19 | 2007+ 'XLSX' files. | |
33 | - The function installXLSXsupport() has been provided to install the | |
34 | binary perl modules that read.xls needs to support Excel 2007+ | |
35 | 'XLSX' files. | |
20 | 36 | |
21 | 37 | |
22 | 38 | CHANGES IN 2.7.3 (2010-04-02) |
Binary diff not shown
Binary diff not shown
46 | 46 | \code{read.table} since the first character of all lines (including |
47 | 47 | comment lines) will be "\"" after conversion. |
48 | 48 | |
49 | If you have quotes in your data which confuse the process you may wish to use | |
50 | \code{read.xls(..., quote = '')}. This will cause the quotes to be regarded | |
51 | as data and you will have to then handle the quotes yourself after reading | |
52 | the file in. | |
53 | ||
49 | 54 | Caution: If you call \code{"xls2csv"} directly, is your responsibility |
50 | 55 | to close and delete the file after using it. |
51 | 56 | } |
83 | 88 | |
84 | 89 | # Example specifying exact Perl path for Unix systems |
85 | 90 | iris <- read.xls(xlsfile, perl="/usr/bin/perl") |
91 | ||
92 | # finding perl | |
93 | # (read.xls automatically calls findPerl so this is rarely needed) | |
94 | perl <- gdata:::findPerl("perl") | |
95 | iris <- read.xls(xlsfile, perl=perl) | |
86 | 96 | |
87 | 97 | # read xls file from net |
88 | 98 | nba.url <- "http://mgtclass.mgt.unm.edu/Bose/Excel/Tutorial.05/Cases/NBA.xls" |
0 | 0 | % write.fwf.Rd |
1 | 1 | %-------------------------------------------------------------------------- |
2 | 2 | % What: Write fixed width format man page |
3 | % $Id: write.fwf.Rd 1357 2009-08-20 14:54:44Z warnes $ | |
3 | % $Id: write.fwf.Rd 1459 2010-11-12 19:08:12Z warnes $ | |
4 | 4 | % Time-stamp: <2008-08-05 12:40:32 ggorjan> |
5 | 5 | %-------------------------------------------------------------------------- |
6 | 6 | |
21 | 21 | |
22 | 22 | write.fwf(x, file="", append=FALSE, quote=FALSE, sep=" ", na="", |
23 | 23 | rownames=FALSE, colnames=TRUE, rowCol=NULL, justify="left", |
24 | formatInfo=FALSE, quoteInfo=TRUE, width=NULL, \dots) | |
24 | formatInfo=FALSE, quoteInfo=TRUE, width=NULL, eol="\n", | |
25 | qmethod=c("escape", "double"), \dots) | |
25 | 26 | |
26 | 27 | } |
27 | 28 | |
43 | 44 | widths and format} |
44 | 45 | \item{quoteInfo}{logical, should \code{formatInfo} account for quotes} |
45 | 46 | \item{width}{numeric, width of the columns in the output} |
46 | \item{\dots}{further arguments to \code{\link{format.info}}, | |
47 | \code{\link{format}} and \code{\link{write.table}}} | |
47 | \item{eol}{the character(s) to print at the end of each line (row). | |
48 | For example, 'eol="\\r\\n"' will produce Windows' line endings on a | |
49 | Unix-alike OS, and 'eol="\\r"' will produce files as expected by Mac | |
50 | OS Excel 2004.} | |
51 | \item{qmethod}{a character string specifying how to deal with embedded | |
52 | double quote characters when quoting strings. Must be one of | |
53 | '"escape"' (default), in which case the quote character is | |
54 | escaped in C style by a backslash, or '"double"', in which | |
55 | case it is doubled. You can specify just the initial letter.} | |
56 | \item{\dots}{further arguments to | |
57 | \code{\link{format.info}} and \code{\link{format}} | |
58 | } | |
48 | 59 | } |
49 | 60 | |
50 | 61 | \details{ |
0 | 0 | |
1 | R version 2.11.0 (2010-04-22) | |
1 | R version 2.12.0 (2010-10-15) | |
2 | 2 | Copyright (C) 2010 The R Foundation for Statistical Computing |
3 | 3 | ISBN 3-900051-07-0 |
4 | Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) | |
4 | 5 | |
5 | 6 | R is free software and comes with ABSOLUTELY NO WARRANTY. |
6 | 7 | You are welcome to redistribute it under certain conditions. |
7 | 8 | Type 'license()' or 'licence()' for distribution details. |
8 | 9 | |
9 | Natural language support but running in an English locale | |
10 | ||
11 | 10 | R is a collaborative project with many contributors. |
12 | 11 | Type 'contributors()' for more information and |
13 | 12 | 'citation()' on how to cite R or R packages in publications. |
17 | 16 | Type 'q()' to quit R. |
18 | 17 | |
19 | 18 | > library(gdata) |
19 | gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED. | |
20 | ||
21 | gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED. | |
20 | 22 | |
21 | 23 | Attaching package: 'gdata' |
22 | 24 | |
25 | 27 | object.size |
26 | 28 | |
27 | 29 | > |
30 | > if ( ! 'XLSX' %in% xlsFormats() ) | |
31 | + { | |
32 | + try( installXLSXModules() ) | |
33 | + } | |
28 | 34 | > |
29 | 35 | > # iris.xls is included in the gregmisc package for use as an example |
30 | 36 | > xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls') |
31 | 37 | > |
32 | 38 | > iris.1 <- read.xls(xlsfile) # defaults to csv format |
33 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
34 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
35 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
36 | 39 | > iris.1 |
37 | 40 | Sepal.Length Sepal.Width Petal.Length Petal.Width Species |
38 | 41 | 1 5.1 3.5 1.4 0.2 setosa |
187 | 190 | 150 5.9 3.0 5.1 1.8 virginica |
188 | 191 | > |
189 | 192 | > iris.2 <- read.xls(xlsfile,method="csv") # specify csv format |
190 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
191 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
192 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
193 | 193 | > iris.2 |
194 | 194 | Sepal.Length Sepal.Width Petal.Length Petal.Width Species |
195 | 195 | 1 5.1 3.5 1.4 0.2 setosa |
344 | 344 | 150 5.9 3.0 5.1 1.8 virginica |
345 | 345 | > |
346 | 346 | > iris.3 <- read.xls(xlsfile,method="tab") # specify tab format |
347 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
348 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
349 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
350 | 347 | > iris.3 |
351 | 348 | Sepal.Length Sepal.Width Petal.Length Petal.Width Species |
352 | 349 | 1 5.1 3.5 1.4 0.2 setosa |
511 | 508 | > |
512 | 509 | > # see the number and names of sheets: |
513 | 510 | > sheetCount(exampleFile) |
514 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
515 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
516 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
517 | 511 | [1] 4 |
518 | 512 | > |
519 | 513 | > if( 'XLSX' %in% xlsFormats() ) |
520 | 514 | + sheetCount(exampleFile2007) |
515 | [1] 4 | |
521 | 516 | > |
522 | 517 | > sheetNames(exampleFile) |
523 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
524 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
525 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
526 | 518 | [1] "Sheet First" "Sheet Second" |
527 | 519 | [3] "Sheet with a very long name!" "Sheet with initial text" |
528 | 520 | > |
529 | 521 | > if( 'XLSX' %in% xlsFormats() ) |
530 | 522 | + sheetNames(exampleFile2007) |
523 | [1] "Sheet First" "Sheet Second" | |
524 | [3] "Sheet with a very long name!" "Sheet with initial text" | |
531 | 525 | > |
532 | 526 | > example.1 <- read.xls(exampleFile, sheet=1) # default is first worksheet |
533 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
534 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
535 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
536 | 527 | > example.1 |
537 | 528 | A B C |
538 | 529 | 1 1 1 1 |
544 | 535 | 7 7 49 343 |
545 | 536 | > |
546 | 537 | > example.2 <- read.xls(exampleFile, sheet=2) # second worksheet by number |
547 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
548 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
549 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
550 | 538 | > example.2 |
551 | 539 | X D E F G Factor |
552 | 540 | 1 FirstRow 1 NA NA NA Red |
555 | 543 | 4 FourthRow 4 3 2 1 Black |
556 | 544 | > |
557 | 545 | > example.3 <- read.xls(exampleFile, sheet=3) # second worksheet by number |
558 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
559 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
560 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
561 | 546 | > example.3 |
562 | 547 | X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A |
563 | 548 | 1 2 2002-02-02 2:02 0.2910708 NA B |
571 | 556 | 9 10 2010-10-10 10:10 0.6508541 0.0000000 A |
572 | 557 | > |
573 | 558 | > example.4 <- read.xls(exampleFile, sheet=3) # second worksheet by number |
574 | WARNING: Perl module Compress::Raw::Zlib cannot be loaded. | |
575 | WARNING: Perl module Spreadsheet::XLSX cannot be loaded. | |
576 | WARNING: Microsoft Excel 2007 'XLSX' formatted files will not be processed. | |
577 | 559 | > example.4 |
578 | 560 | X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A |
579 | 561 | 1 2 2002-02-02 2:02 0.2910708 NA B |
607 | 589 | + data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2) |
608 | 590 | + print(data) |
609 | 591 | + } |
610 | > | |
611 | > proc.time() | |
612 | user system elapsed | |
613 | 1.350 0.285 1.659 | |
592 | A B C | |
593 | 1 1 1 1 | |
594 | 2 2 4 8 | |
595 | 3 3 9 27 | |
596 | 4 4 16 64 | |
597 | 5 5 25 125 | |
598 | 6 6 36 216 | |
599 | 7 7 49 343 | |
600 | X D E F G Factor | |
601 | 1 FirstRow 1 NA NA NA Red | |
602 | 2 SecondRow 2 1 NA NA Green | |
603 | 3 ThirdRow 3 2 1 NA Red | |
604 | 4 FourthRow 4 3 2 1 Black | |
605 | X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A | |
606 | 1 2 2002-02-02 2:02 0.2910708 NA B | |
607 | 2 3 2003-03-03 3:03 0.3564875 -0.8414710 C | |
608 | 3 4 2004-04-04 4:04 0.4116363 0.7080734 | |
609 | 4 5 2005-05-05 5:05 0.4602234 0.5013680 A | |
610 | 5 6 2006-06-06 6:06 NA 0.2513698 B | |
611 | 6 7 2007-07-07 7:07 0.5445436 0.0631868 B | |
612 | 7 8 2008-08-08 8:08 0.5821416 NA C | |
613 | 8 9 2009-09-09 9:09 0.6174545 0.0000000 A | |
614 | 9 10 2010-10-10 10:10 0.6508541 0.0000000 A | |
615 | X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A | |
616 | 1 2 2002-02-02 2:02 0.2910708 NA B | |
617 | 2 3 2003-03-03 3:03 0.3564875 -0.8414710 C | |
618 | 3 4 2004-04-04 4:04 0.4116363 0.7080734 | |
619 | 4 5 2005-05-05 5:05 0.4602234 0.5013680 A | |
620 | 5 6 2006-06-06 6:06 NA 0.2513698 B | |
621 | 6 7 2007-07-07 7:07 0.5445436 0.0631868 B | |
622 | 7 8 2008-08-08 8:08 0.5821416 NA C | |
623 | 8 9 2009-09-09 9:09 0.6174545 0.0000000 A | |
624 | 9 10 2010-10-10 10:10 0.6508541 0.0000000 A | |
625 | X D E F G Factor | |
626 | 1 FirstRow 1 NA NA NA Red | |
627 | 2 SecondRow 2 1 NA NA Green | |
628 | 3 ThirdRow 3 2 1 NA Red | |
629 | 4 FourthRow 4 3 2 1 Black | |
630 | X X.1 D E F G Factor | |
631 | 1 NA FirstRow 1 NA NA NA Red | |
632 | 2 NA SecondRow 2 1 NA NA Green | |
633 | 3 NA ThirdRow 3 2 1 NA Red | |
634 | 4 NA FourthRow 4 3 2 1 Black | |
635 | > |
0 | library(gdata) | |
1 | saveto <- tempfile(pattern = "test.txt", tmpdir = tempdir()) | |
2 | ||
3 | write.fwf(x = data.frame(a=1:length(LETTERS), b=LETTERS), | |
4 | file=saveto, eol="\r\n") |
0 | 0 | |
1 | R version 2.9.0 (2009-04-17) | |
2 | Copyright (C) 2009 The R Foundation for Statistical Computing | |
1 | R version 2.12.0 (2010-10-15) | |
2 | Copyright (C) 2010 The R Foundation for Statistical Computing | |
3 | 3 | ISBN 3-900051-07-0 |
4 | Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) | |
4 | 5 | |
5 | 6 | R is free software and comes with ABSOLUTELY NO WARRANTY. |
6 | 7 | You are welcome to redistribute it under certain conditions. |
22 | 23 | > ###------------------------------------------------------------------------ |
23 | 24 | > |
24 | 25 | > library(gdata) |
26 | gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED. | |
27 | ||
28 | gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED. | |
25 | 29 | |
26 | 30 | Attaching package: 'gdata' |
27 | 31 | |
28 | ||
29 | The following object(s) are masked from package:utils : | |
30 | ||
31 | object.size | |
32 | The following object(s) are masked from 'package:utils': | |
33 | ||
34 | object.size | |
32 | 35 | |
33 | 36 | > |
34 | 37 | > ## --- Test data --- |