On Sep 28, 2006, at 12:45 PM, Ivan Alves wrote:
> Here is the problem (I thought), since I get
>
> > iconv("Compa\361ia","latin1","UTF-8")
> [1] "Compa\303\261ia"
>
> in both the command-line R (in Terminal) and in the GUI.
Now this is definitely a problem. Which locale are you running (i.e.
which language is first in "System Preferences" -> "International" ->
"Language" and which region in "Formats")? Also send me the output of
Sys.getenv("LANG") in the GUI, you should get something like:
> Sys.getenv("LANG")
LANG
"en_US.UTF-8"
>> So when you are loading your table, you should be using something
>> like
>> read.table(file("my.table",encoding="latin1"))
>> to get the correct result.
>>
> This was among the many things that I tried and I got
>
> test <- read.table(file("~/Projects/Isis/data/large_general.csv",
> encoding="latin1"))
> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
> na.strings, :
> line 1 did not have 93 elements
> In addition: Warning messages:
> 1: invalid input found on input connection '~/Projects/Isis/data/
> large_general.csv'
> 2: incomplete final line found by readTableHeader on '~/Projects/
> Isis/data/large_general.csv'
>
> and the reading stops, my guess consequence of the first "return"
> that it hits. With read.csv at least one error dissapears, but the
> output is the same
>
> > test <- read.csv(file("~/Projects/Isis/data/large_general.csv",
> encoding="latin1"))
> Warning messages:
> 1: invalid input found on input connection '~/Projects/Isis/data/
> large_general.csv'
> 2: incomplete final line found by readTableHeader on '~/Projects/
> Isis/data/large_general.csv'
>
> I am confused.
This seems more like a problem in the file format - possibly
incompatible line endings?
Cheers,
Simon
[[alternative HTML version deleted]]
_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac