Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to read.table with "Hebrew" column names (in R)?
    text
    copied!<p>I am trying to read a .txt file, with Hebrew column names, but without success.</p> <p>I uploaded an example file to: <a href="http://www.talgalili.com/files/aa.txt" rel="nofollow noreferrer">http://www.talgalili.com/files/aa.txt</a></p> <p>And am trying the command:</p> <pre><code>read.table("http://www.talgalili.com/files/aa.txt", header = T, sep = "\t") </code></pre> <p>This returns me with:</p> <pre><code> X.....ª X...ª...... X...œ.... 1 12 97 6 2 123 354 44 3 6 1 3 </code></pre> <p>Instead of:</p> <pre><code>אחת שתיים שלוש 12 97 6 123 354 44 6 1 3 </code></pre> <p>My output for:</p> <pre><code>l10n_info() </code></pre> <p>Is:</p> <pre><code>$MBCS [1] FALSE $`UTF-8` [1] FALSE $`Latin-1` [1] TRUE $codepage [1] 1252 </code></pre> <p>And for:</p> <pre><code>Sys.getlocale() </code></pre> <p>Is:</p> <pre><code>[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252" </code></pre> <p>Can you suggest to me what to try and change to allow me to load the file correctly ?</p> <p><strong>Update:</strong> Trying to use:</p> <pre><code>read.table("http://www.talgalili.com/files/aa.txt",fileEncoding ="iso8859-8") </code></pre> <p>Has resulted in:</p> <pre><code> V1 1 ? Warning messages: 1: In read.table("http://www.talgalili.com/files/aa.txt", fileEncoding = "iso8859-8") : invalid input found on input connection 'http://www.talgalili.com/files/aa.txt' 2: In read.table("http://www.talgalili.com/files/aa.txt", fileEncoding = "iso8859-8") : incomplete final line found by readTableHeader on 'http://www.talgalili.com/files/aa.txt' </code></pre> <p>While also trying this:</p> <pre><code>Sys.setlocale("LC_ALL", "en_US.UTF-8") </code></pre> <p>Or this:</p> <pre><code>Sys.setlocale("LC_ALL", "en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8") </code></pre> <p>Get's me this:</p> <pre><code>[1] "" Warning message: In Sys.setlocale("LC_ALL", "en_US.UTF-8") : OS reports request to set locale to "en_US.UTF-8" cannot be honored </code></pre> <p>Finally, here is the > sessionInfo() </p> <pre><code>R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1255 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.1 </code></pre> <p>Any suggestion or clarification will be appreciated.</p> <p>Best, Tal</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload