Codebase list gdata / 6c05816
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
17 changed file(s) with 320 addition(s) and 85 deletion(s). Raw diff Collapse all Expand all
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
050 2010-05-03 13:35 warnes
151
252 * [r1437] DESCRIPTION, NAMESPACE, R/installXLSXModules.R,
22 Description: Various R programming tools for data manipulation
33 Depends: R (>= 2.6.0)
44 Imports: gtools
5 Version: 2.8.0
6 Date: 2010-04-03
5 Version: 2.8.1
6 Date: 2010-11-12
77 Author: Gregory R. Warnes, with contributions from Ben Bolker, Gregor
88 Gorjanc, Gabor Grothendieck, Ales Korosec, Thomas Lumley, Don
99 MacQueen, Arni Magnusson, Jim Rogers, and others
1010 Maintainer: Gregory Warnes <greg@warnes.net>
1111 License: GPL-2
12 Packaged: 2010-05-03 16:26:31 UTC; warnes
12 Packaged: 2010-11-12 19:20:23 UTC; warnes
1313 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
016 CHANGES IN 2.8.0 (2010-04-03)
117 -----------------------------
218
1430 installXLSXsupport() function to attempt to install the necessary
1531 perl libraries.
1632
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.
2036
2137
2238 CHANGES IN 2.7.3 (2010-04-02)
00 .onAttach <- function(libname, pkgname)
11 {
22 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 )
510
611 try(
712 {
00 ### write.fwf.R
11 ###------------------------------------------------------------------------
22 ### 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 $
44 ### Time-stamp: <2008-08-05 12:11:27 ggorjan>
55 ###------------------------------------------------------------------------
66
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 ...)
1123 {
1224 ## --- Setup ---
1325
136148
137149 if(colnames) {
138150 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 }
142162
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)
145173
146174 ## --- Return format and fixed width information ---
147175
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 $
11
22 xls2csv <- function(xls, sheet=1, verbose=FALSE, ..., perl="perl")
33 xls2sep(xls=xls, sheet=sheet, verbose=verbose, ..., method="csv",
1212 perl=perl)
1313
1414 xls2sep <- function(xls, sheet=1, verbose=FALSE, ...,
15 method=c("csv","tsv","tab"), perl="perl")
15 method=c("csv","tsv","tab"), perl = perl)
1616 {
1717
1818 method <- match.arg(method)
1919
20 perl <- if (missing(perl))
21 findPerl(verbose = verbose)
22 else
23 findPerl(perl, verbose = verbose)
24
2025 ##
2126 ## directories
2227 package.dir <- .path.package('gdata')
3843 if(verbose) cat("Done.\n")
3944 xls <- tf
4045 }
41
42 if(file.access(xls, 4)!=0)
43 stop("Unable to read xls file '", xls, "'." )
4446
4547 if(method=="csv")
4648 {
8991 ##
9092 ## do the translation
9193 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
92103 ##
93 results <- system(cmd, intern=!verbose)
94 if(verbose) cat(results,"\n\n")
104 ## check that the target file was created
95105 ##
96 if (verbose) cat("Done.\n\n")
97 ##
98 ##
106 if(!file.exists(targetFile))
107 stop( "Intermediate file '", targetFile, "' missing!" )
99108
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)
102115
103 if (verbose) cat("Done.\n")
104
116 return(retval)
105117
106 ## prepare for cleanup now, in case of error reading file
107 file(targetFile)
108118 }
109119
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
09 gdata (2.8.0-1) unstable; urgency=low
110
211 * New upstream release
11 Section: gnu-r
22 Priority: optional
33 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
66
77 Package: r-cran-gdata
88 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
1010 Replaces: r-cran-gregmisc (<= 2.0.7-1)
1111 Description: GNU R package with data manipulation tools by Greg Warnes et al
1212 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
050 2010-05-03 13:35 warnes
151
252 * [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
016 CHANGES IN 2.8.0 (2010-04-03)
117 -----------------------------
218
1430 installXLSXsupport() function to attempt to install the necessary
1531 perl libraries.
1632
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.
2036
2137
2238 CHANGES IN 2.7.3 (2010-04-02)
Binary diff not shown
Binary diff not shown
4646 \code{read.table} since the first character of all lines (including
4747 comment lines) will be "\"" after conversion.
4848
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
4954 Caution: If you call \code{"xls2csv"} directly, is your responsibility
5055 to close and delete the file after using it.
5156 }
8388
8489 # Example specifying exact Perl path for Unix systems
8590 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)
8696
8797 # read xls file from net
8898 nba.url <- "http://mgtclass.mgt.unm.edu/Bose/Excel/Tutorial.05/Cases/NBA.xls"
00 % write.fwf.Rd
11 %--------------------------------------------------------------------------
22 % 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 $
44 % Time-stamp: <2008-08-05 12:40:32 ggorjan>
55 %--------------------------------------------------------------------------
66
2121
2222 write.fwf(x, file="", append=FALSE, quote=FALSE, sep=" ", na="",
2323 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)
2526
2627 }
2728
4344 widths and format}
4445 \item{quoteInfo}{logical, should \code{formatInfo} account for quotes}
4546 \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 }
4859 }
4960
5061 \details{
00
1 R version 2.11.0 (2010-04-22)
1 R version 2.12.0 (2010-10-15)
22 Copyright (C) 2010 The R Foundation for Statistical Computing
33 ISBN 3-900051-07-0
4 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
45
56 R is free software and comes with ABSOLUTELY NO WARRANTY.
67 You are welcome to redistribute it under certain conditions.
78 Type 'license()' or 'licence()' for distribution details.
89
9 Natural language support but running in an English locale
10
1110 R is a collaborative project with many contributors.
1211 Type 'contributors()' for more information and
1312 'citation()' on how to cite R or R packages in publications.
1716 Type 'q()' to quit R.
1817
1918 > 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.
2022
2123 Attaching package: 'gdata'
2224
2527 object.size
2628
2729 >
30 > if ( ! 'XLSX' %in% xlsFormats() )
31 + {
32 + try( installXLSXModules() )
33 + }
2834 >
2935 > # iris.xls is included in the gregmisc package for use as an example
3036 > xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls')
3137 >
3238 > 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.
3639 > iris.1
3740 Sepal.Length Sepal.Width Petal.Length Petal.Width Species
3841 1 5.1 3.5 1.4 0.2 setosa
187190 150 5.9 3.0 5.1 1.8 virginica
188191 >
189192 > 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.
193193 > iris.2
194194 Sepal.Length Sepal.Width Petal.Length Petal.Width Species
195195 1 5.1 3.5 1.4 0.2 setosa
344344 150 5.9 3.0 5.1 1.8 virginica
345345 >
346346 > 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.
350347 > iris.3
351348 Sepal.Length Sepal.Width Petal.Length Petal.Width Species
352349 1 5.1 3.5 1.4 0.2 setosa
511508 >
512509 > # see the number and names of sheets:
513510 > 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.
517511 [1] 4
518512 >
519513 > if( 'XLSX' %in% xlsFormats() )
520514 + sheetCount(exampleFile2007)
515 [1] 4
521516 >
522517 > 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.
526518 [1] "Sheet First" "Sheet Second"
527519 [3] "Sheet with a very long name!" "Sheet with initial text"
528520 >
529521 > if( 'XLSX' %in% xlsFormats() )
530522 + sheetNames(exampleFile2007)
523 [1] "Sheet First" "Sheet Second"
524 [3] "Sheet with a very long name!" "Sheet with initial text"
531525 >
532526 > 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.
536527 > example.1
537528 A B C
538529 1 1 1 1
544535 7 7 49 343
545536 >
546537 > 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.
550538 > example.2
551539 X D E F G Factor
552540 1 FirstRow 1 NA NA NA Red
555543 4 FourthRow 4 3 2 1 Black
556544 >
557545 > 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.
561546 > example.3
562547 X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A
563548 1 2 2002-02-02 2:02 0.2910708 NA B
571556 9 10 2010-10-10 10:10 0.6508541 0.0000000 A
572557 >
573558 > 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.
577559 > example.4
578560 X1 X2001.01.01 X1.01 X0.205818150587141 X.DIV.0. A
579561 1 2 2002-02-02 2:02 0.2910708 NA B
607589 + data <- read.xls(exampleFile2007, sheet="Sheet with initial text", skip=2)
608590 + print(data)
609591 + }
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")
00
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
33 ISBN 3-900051-07-0
4 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
45
56 R is free software and comes with ABSOLUTELY NO WARRANTY.
67 You are welcome to redistribute it under certain conditions.
2223 > ###------------------------------------------------------------------------
2324 >
2425 > 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.
2529
2630 Attaching package: 'gdata'
2731
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
3235
3336 >
3437 > ## --- Test data ---