Skip to content
Prev 316820 / 398506 Next

Wide character in print?

On Feb 4, 2013, at 10:39 AM, Spencer Graves <spencer.graves at structuremonitoring.com> wrote:

            
Spencer,

The error message is coming from Perl, not from R and from what I understand, is typically encountered when there are UTF-8/Unicode characters in the source. "Wide character" apparently referring to multi-byte encodings.

Having downloaded the Excel file you indicate above, my first reaction is that it is not really structured in a way to facilitate automated parsing to a CSV file (the intermediate step before using read.table()) to then be read into R to a data frame. They are not purely rows and columns of data, which is the typical application for read.xls().

There are lengthy header lines in the worksheets, some of which include copyright symbols, which is likely why you are getting the error from Perl. There are also embedded objects in the worksheets, which appear to be image crops of tables from a paper. I honestly don't know if read.xls() is set up to handle that stuff and you may need to contact the maintainers.

Given the above, I am not sure what I would recommend if your goal is to parse the raw data contained in the Excel worksheets and include them in a package. You may need to copy and paste the data ranges to the OS clipboard and read them into R from there, or consider using a different R package that has more flexibility in defining the specific Excel worksheet cell ranges that you want to extract.

Others may have different ideas for you.

Regards,

Marc Schwartz