Re: [R] open xlsx file using read.xls function of gdata package

2015-04-05 Thread Keith S Weintraub
Will it work with .xlsm files?

Best,
KW

 You might try the readxl package - it's only available on github but it
 reads both xlsx and xls. All going well, it should be on its way to CRAN
 next week.
 
 Hadley
 
 On Friday, April 3, 2015, Luigi Marongiu marongiu.lu...@gmail.com wrote:
 
 Dear all,
 I am trying to open excel files using the gdata package. I can do that
 using a .xls file, but the same file, containing the same data,
 formatted in .xlsx gives error (R does not recognize the pattern from
 where to start reading the data).
 Doen anybody knows whether it is possible to read .xlslx with this package?
 Am I missing another package to implement the reading of the .xlsx?
 Thank you
 Luigi
 
 PS: this is the error I get:
 my.file - array.xlsx
 my.data-read.xls(
 +   my.file,
 +   sheet=sheet x,
 +   verbose=FALSE,
 +   pattern=row name,
 +   na.strings=c(NA,#DIV/0!),
 +   method=tab,
 +   perl=perl
 + )
 Warning message:
 In read.xls(my.file, sheet = sheet x, verbose = FALSE,  :
  pattern not found
 
 
 The verbose version runs like this:
?array.xlsx?
 to tab  file
?/tmp/Rtmp2tAjzz/filef06102dd018.tab?
 ...
 
 Executing ' '/usr/bin/perl'
 '/home/gigiux/R/x86_64-pc-linux-gnu-library/3.0/gdata/perl/xls2tab.pl'
 'array.xlsx' '/tmp/Rtmp2tAjzz/filef06102dd018.tab' 'sheet x' '...
 
 Loading 'array.xlsx'...
 Done.
 
 Orignal Filename: array.xlsx
 Number of Sheets: 2
 
 Writing sheet 'sheet x' to file '/tmp/Rtmp2tAjzz/filef06102dd018.tab'
 Minrow=31 Maxrow=17310 Mincol=0 Maxcol=4
  (Ignored 0 blank lines.)
 
 0
 
 Done.
 
 Searching for lines tfntaining pattern  row name ...
 Warning message:
 In read.xls(my.file, sheet = sheet x, verbose = TRUE,  :
  pattern not found
 
 
 __
 R-help@r-project.org javascript:; mailing list -- To UNSUBSCRIBE and
 more, see
 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.
 
 
 
 -- 
 http://had.co.nz/
 
   [[alternative HTML version deleted]]
 
 


---
KW

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Luigi Marongiu
Dear all,
I am trying to open excel files using the gdata package. I can do that
using a .xls file, but the same file, containing the same data,
formatted in .xlsx gives error (R does not recognize the pattern from
where to start reading the data).
Doen anybody knows whether it is possible to read .xlslx with this package?
Am I missing another package to implement the reading of the .xlsx?
Thank you
Luigi

PS: this is the error I get:
 my.file - array.xlsx
 my.data-read.xls(
+   my.file,
+   sheet=sheet x,
+   verbose=FALSE,
+   pattern=row name,
+   na.strings=c(NA,#DIV/0!),
+   method=tab,
+   perl=perl
+ )
 Warning message:
In read.xls(my.file, sheet = sheet x, verbose = FALSE,  :
  pattern not found


The verbose version runs like this:
“array.xlsx”
to tab  file
“/tmp/Rtmp2tAjzz/filef06102dd018.tab”
...

Executing ' '/usr/bin/perl'
'/home/gigiux/R/x86_64-pc-linux-gnu-library/3.0/gdata/perl/xls2tab.pl'
 'array.xlsx' '/tmp/Rtmp2tAjzz/filef06102dd018.tab' 'sheet x' '...

Loading 'array.xlsx'...
Done.

Orignal Filename: array.xlsx
Number of Sheets: 2

Writing sheet 'sheet x' to file '/tmp/Rtmp2tAjzz/filef06102dd018.tab'
Minrow=31 Maxrow=17310 Mincol=0 Maxcol=4
  (Ignored 0 blank lines.)

0

Done.

Searching for lines tfntaining pattern  row name ...
Warning message:
In read.xls(my.file, sheet = sheet x, verbose = TRUE,  :
  pattern not found


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Jeff Newmiller
I had poor luck with gdata. I have had better luck with XLConnect. There is no 
single best package for this, since each seems to leverage efforts made in 
other languages (so there are non-R configuration requirements to keep working) 
and Excel is a proprietary moving target. In general YMMV when it comes to 
Excel data. In most cases I just export the data to CSV and avoid the issue.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On April 3, 2015 11:24:29 AM PDT, Luigi Marongiu marongiu.lu...@gmail.com 
wrote:
Dear all,
I am trying to open excel files using the gdata package. I can do that
using a .xls file, but the same file, containing the same data,
formatted in .xlsx gives error (R does not recognize the pattern from
where to start reading the data).
Doen anybody knows whether it is possible to read .xlslx with this
package?
Am I missing another package to implement the reading of the .xlsx?
Thank you
Luigi

PS: this is the error I get:
 my.file - array.xlsx
 my.data-read.xls(
+   my.file,
+   sheet=sheet x,
+   verbose=FALSE,
+   pattern=row name,
+   na.strings=c(NA,#DIV/0!),
+   method=tab,
+   perl=perl
+ )
 Warning message:
In read.xls(my.file, sheet = sheet x, verbose = FALSE,  :
  pattern not found


The verbose version runs like this:
“array.xlsx”
to tab  file
“/tmp/Rtmp2tAjzz/filef06102dd018.tab”
...

Executing ' '/usr/bin/perl'
'/home/gigiux/R/x86_64-pc-linux-gnu-library/3.0/gdata/perl/xls2tab.pl'
 'array.xlsx' '/tmp/Rtmp2tAjzz/filef06102dd018.tab' 'sheet x' '...

Loading 'array.xlsx'...
Done.

Orignal Filename: array.xlsx
Number of Sheets: 2

Writing sheet 'sheet x' to file '/tmp/Rtmp2tAjzz/filef06102dd018.tab'
Minrow=31 Maxrow=17310 Mincol=0 Maxcol=4
  (Ignored 0 blank lines.)

0

Done.

Searching for lines tfntaining pattern  row name ...
Warning message:
In read.xls(my.file, sheet = sheet x, verbose = TRUE,  :
  pattern not found


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Hadley Wickham
You might try the readxl package - it's only available on github but it
reads both xlsx and xls. All going well, it should be on its way to CRAN
next week.

Hadley

On Friday, April 3, 2015, Luigi Marongiu marongiu.lu...@gmail.com wrote:

 Dear all,
 I am trying to open excel files using the gdata package. I can do that
 using a .xls file, but the same file, containing the same data,
 formatted in .xlsx gives error (R does not recognize the pattern from
 where to start reading the data).
 Doen anybody knows whether it is possible to read .xlslx with this package?
 Am I missing another package to implement the reading of the .xlsx?
 Thank you
 Luigi

 PS: this is the error I get:
  my.file - array.xlsx
  my.data-read.xls(
 +   my.file,
 +   sheet=sheet x,
 +   verbose=FALSE,
 +   pattern=row name,
 +   na.strings=c(NA,#DIV/0!),
 +   method=tab,
 +   perl=perl
 + )
  Warning message:
 In read.xls(my.file, sheet = sheet x, verbose = FALSE,  :
   pattern not found


 The verbose version runs like this:
 “array.xlsx”
 to tab  file
 “/tmp/Rtmp2tAjzz/filef06102dd018.tab”
 ...

 Executing ' '/usr/bin/perl'
 '/home/gigiux/R/x86_64-pc-linux-gnu-library/3.0/gdata/perl/xls2tab.pl'
  'array.xlsx' '/tmp/Rtmp2tAjzz/filef06102dd018.tab' 'sheet x' '...

 Loading 'array.xlsx'...
 Done.

 Orignal Filename: array.xlsx
 Number of Sheets: 2

 Writing sheet 'sheet x' to file '/tmp/Rtmp2tAjzz/filef06102dd018.tab'
 Minrow=31 Maxrow=17310 Mincol=0 Maxcol=4
   (Ignored 0 blank lines.)

 0

 Done.

 Searching for lines tfntaining pattern  row name ...
 Warning message:
 In read.xls(my.file, sheet = sheet x, verbose = TRUE,  :
   pattern not found
 

 __
 R-help@r-project.org javascript:; mailing list -- To UNSUBSCRIBE and
 more, see
 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.



-- 
http://had.co.nz/

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.