Re: [R] Encoding issue

2018-11-05 Thread Sebastien Bihorel
astien - Original Message - From: "Ivan Krylov" To: "Sebastien Bihorel" Cc: r-help@r-project.org Sent: Monday, November 5, 2018 2:34:02 PM Subject: Re: [R] Encoding issue On Mon, 5 Nov 2018 08:36:13 -0500 (EST) Sebastien Bihorel wrote: > [1] "râs" Interesting

Re: [R] Encoding issue

2018-11-05 Thread Ivan Krylov
On Mon, 5 Nov 2018 08:36:13 -0500 (EST) Sebastien Bihorel wrote: > [1] "râs" Interesting. This is what I get if I decode the bytes 72 e2 80 99 73 0a as latin-1 instead of UTF-8. They look like there is only three characters, but, actually, there is more: $ perl -CSD -Mcharnames=:full -MEncode=d

[R] Encoding issue

2018-11-05 Thread Sebastien Bihorel
Hi, I am having problems getting similar output when processing the same markdown files on 2 different Linux systems (one is a laptop with Linux Mint 18.3, the other is a production server running on CentOS 7). I think this boils down to an encoding issue but I am not sure if this is a system-w

Re: [R] encoding/locale problem with ssh -X

2017-06-23 Thread Andreas Leha
Hi Paul, Thanks for following this up! It used to be R version 3.3.1 I updated to R version 3.4.0 Now everything seems to work! Many thanks! Best, Andreas On 23/06/17 03:02, Paul Murrell wrote: > Hi > > What version of R do you have (on the remote machine) ? > > I can replicate this with

[R] encoding/locale problem with ssh -X

2017-06-21 Thread Andreas Leha
Hi all, I am struggling with remote R sessions and a (I suspect) locale related encoding problem: Using the X11 device (X11forwarding enabled), whenever I try to plot something containing umlauts using ggplot2, I am seeing sth like , | Error in grid.Call(L_stringMetric, as.graphicsAnnot(x$la

[R] Encoding issue

2014-01-06 Thread Dennis Fisher
R 3.0.2 OS X Colleagues, I know little about encoding so please be patient with this question. I have a CSV file created from a SAS7BDAT dataset (using Shotwell's SAS7BDAT package). In the CSV file, when opened with XL, one entry reads as: ¸æçñàºmol/L When I read this into R, that en

Re: [R] Encoding

2012-10-28 Thread Eva Prieto Castro
Hi Duncan: The problem is that in Windows I can't do the source() with encoding="utf-8", so I don't reach the step of adjusting DESCRIPTION file. Eva --- El dom, 28/10/12, Duncan Murdoch escribió: De: Duncan Murdoch Asunto: Re: [R] Encoding Para: "Eva Pri

Re: [R] Encoding

2012-10-28 Thread Eva Prieto Castro
Hi Duncan, What dos it happen if I need use non-ASCII characters?. Is there no way in order to make the package in Windows PC and it runs on Mac?. I am lost, very lost. Thanks. Eva --- El dom, 28/10/12, Duncan Murdoch escribió: De: Duncan Murdoch Asunto: Re: [R] Encoding Para: "Eva P

Re: [R] Encoding

2012-10-28 Thread Duncan Murdoch
ckage. If you have a better editor I'd choose UTF-8 with no byte-order mark. Duncan Murdoch Eva --- El *dom, 28/10/12, Duncan Murdoch //* escribió: De: Duncan Murdoch Asunto: Re: [R] Encoding Para: "Eva Prieto Castro" CC: r-help@r-project.org Fecha: domi

Re: [R] Encoding

2012-10-28 Thread Duncan Murdoch
Duncan Murdoch Asunto: Re: [R] Encoding Para: "Eva Prieto Castro" CC: r-help@r-project.org Fecha: domingo, 28 de octubre, 2012 12:05 On 12-10-28 3:49 AM, Eva Prieto Castro wrote: > Hi again, Duncan: > > I understand you tell me, but I don&#x

Re: [R] Encoding

2012-10-28 Thread Duncan Murdoch
ASCII characters besides the degree symbol. Duncan Murdoch Thanks. Eva --- El *sáb, 27/10/12, Duncan Murdoch //* escribió: De: Duncan Murdoch Asunto: Re: [R] Encoding Para: "Eva Prieto Castro" CC: r-help@r-project.org Fecha: sábado, 27 de octubre, 2012 14:12

Re: [R] Encoding

2012-10-28 Thread Eva Prieto Castro
Hi again, Duncan: I understand you tell me, but I don't reach it runs in Mac. How must I do?. Thanks. Eva --- El sáb, 27/10/12, Duncan Murdoch escribió: De: Duncan Murdoch Asunto: Re: [R] Encoding Para: "Eva Prieto Castro" CC: r-help@r-project.org Fecha: sábado, 27 de octu

Re: [R] Encoding

2012-10-27 Thread Duncan Murdoch
On 12-10-27 7:28 AM, Eva Prieto Castro wrote: Hi again: I could make tha package (in Windows 7) but it does not run in Mac. Please could you tell me how to make a package in Windows PC with source code saved in utf-8 in the way the package runs on a Mac ? One likely problem is that you need

Re: [R] Encoding

2012-10-27 Thread Eva Prieto Castro
Hi again: I could make tha package (in Windows 7) but it does not run in Mac. Please could you tell me how to make a package in Windows PC with source code saved in utf-8 in the way the package runs on a Mac ? In my pc (where I create the package) : > l10n_info() $MBCS [1] FALSE $`UTF-8` [1] F

Re: [R] Encoding

2012-10-26 Thread Eva Prieto Castro
Hi, I solved the problem as follows: source(file="example.R", encoding="UCS-2") Thanks Eva --- El sáb, 27/10/12, Eva Prieto Castro escribió: De: Eva Prieto Castro Asunto: Encoding Para: r-help@r-project.org Fecha: sábado, 27 de octubre, 2012 07:34 Hi, I work with R on Windows, so I use AN

[R] Encoding

2012-10-26 Thread Eva Prieto Castro
Hi, I work with R on Windows, so I use ANSI encode; but when I run my projects on a linux or mac pc, It fails, so I change the encoding to unicode (in the same mac pc) and runs ok. The problema is that I need tu make the package in mi pc (windows) and when I save my sources as unicode it fails

Re: [R] Encoding of Sweave file error message

2012-04-12 Thread Duncan Mackay
Hi Rainer Thanks for an alternative. For the record I tried your latex solution on my Windows 7 \usepackage[utf8x]{inputenc} but it failed on the Alt-248 Regards Duncan At 19:13 12/04/2012, you wrote: I also had the same problem. Being on Linux, I prefer Walmes' command line method but

Re: [R] Encoding of Sweave file error message

2012-04-12 Thread Duncan Mackay
Hi Duncan Thank you for the tips I tried \usepackage[latin1]{inputenc} but it still bailed up. tried showNonASCII on the file with the ° typed as Alt-248 (used to doing as DOS value) becomes Alt-176 in ASCII % 1° line resulted in 483: % 1 line The showNonASCII is a nifty function Duncan

Re: [R] Encoding of Sweave file error message

2012-04-12 Thread Duncan Murdoch
On 12-04-12 12:13 AM, Duncan Mackay wrote: At 12:03 12/04/2012, you wrote: I had the same problem! So, as I'm a linux user, I prefer use linux terminal. On terminal I type this to compile R CMD Sweave --encoding=utf-8 myfile.Rnw and the compilation is successful. Try to set the encoding opti

Re: [R] Encoding of Sweave file error message

2012-04-12 Thread Rainer Schuermann
I also had the same problem. Being on Linux, I prefer Walmes' command line method but I found that putting \usepackage[utf8x]{inputenc} as the first instruction in the master .Rnw file also does the trick. No need to change anything after that in the file, at least not for me! Rgds, Rainer On

Re: [R] Encoding of Sweave file error message

2012-04-11 Thread Duncan Mackay
At 12:03 12/04/2012, you wrote: >I had the same problem! So, as I'm a linux user, >I prefer use linux terminal. On terminal I type this to compile > >R CMD Sweave --encoding=utf-8 myfile.Rnw > >and the compilation is successful. Try to set the encoding option in Sweave(). > >Bests. >Walmes. > >=

Re: [R] Encoding of Sweave file error message

2012-04-11 Thread Walmes Zeviani
I had the same problem! So, as I'm a linux user, I prefer use linux terminal. On terminal I type this to compile R CMD Sweave --encoding=utf-8 myfile.Rnw and the compilation is successful. Try to set the encoding option in Sweave(). Bests. Walmes. ===

[R] Encoding of Sweave file error message

2012-04-11 Thread Duncan Mackay
Hi I ran the following sweave file in R2.14.1 and upgraded to R2.15 yesterday with the same setup I got the following error message when I rand the following Sweave file > setwd("D:/Cic/Sweave/Parasite/Comb/12") > Sweave("D:/Cic/Sweave/Parasite/Comb/12/ParasiteComb12.Rnw") Error: c("'ParasiteC

Re: [R] Encoding problem - I fails to read Hebrew text from online

2010-12-10 Thread Tal Galili
Hi Matt and everyone else, Thanks for the help so far. I ended up using the tips provided to create a "dirty hack" based on a translation table between the code and the Hebrew letters. For the future (and for any suggestions), I am attaching this code bellow: Best, Tal # the translation table:

Re: [R] Encoding problem - I fails to read Hebrew text from online

2010-12-09 Thread Matt Shotwell
Tal, OK, let me clarify my understanding. The original and decoded file are text, encoded by UTF-8. In the original file, there are HTML `entities' that represent UTF-8 Hebrew characters. In the decoded file, the entities are converted to UTF-8 characters. The question is how to convert these ent

Re: [R] Encoding problem - I fails to read Hebrew text from online

2010-12-09 Thread Tal Galili
Hi Matt, Thanks for having a look at this. I just spent some time looking around and couldn't find any R function to decode decimal HTML code. Do you (or someone else on the list) knows how to program this sort of thing? (is there a formula for the translation? p.s: For it to work on my end I a

Re: [R] Encoding problem - I fails to read Hebrew text from online

2010-12-09 Thread Matt Shotwell
Tal, It looks like the data you received has HTML special hex characters. That is, 'ש' is just an ASCII HTML representation of a hex character. It's not encoded in a special manner. The trick is to substitute the HTML encoded hex character for its binary representation, or "decode" the character

Re: [R] Encoding problem - I fails to read Hebrew text from online

2010-12-09 Thread Tal Galili
I am bumping this question in the hopes that someone might be able to advise. This Hebrew and R business is not as smooth as I had hoped... Thanks, Tal Older massage: On Tue, Dec 7, 2010 at 2:30 PM, Tal Galili wrote: > Hello all, > > # I am trying to read the text in this URL: > u <- > http://

[R] Encoding problem - I fails to read Hebrew text from online

2010-12-07 Thread Tal Galili
Hello all, # I am trying to read the text in this URL: u <- http://google.com/complete/search?output=toolbar&q=%d7%a9%d7%9c%d7%95%d7%9d # By using this command: readLines(u) And no matter what variation I tried, I keep getting this output: [1] "< (etc...) Instead of this output: ___

Re: [R] FW: R encoding question

2010-11-30 Thread Xiaobo Gu
It does not work, > Sys.setlocale(locale = "Chinese_China") [1] "LC_COLLATE=Chinese_People's Republic of China.936;LC_CTYPE=Chinese_People's Republic of China.936;LC_MONETARY=Chinese_People's Republic of China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936" > library(RpgSQL) .

Re: [R] FW: R encoding question

2010-11-30 Thread Xiaobo Gu
t;>-Original Message- >>From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] >>Sent: Tuesday, November 30, 2010 8:57 PM >>To: Xiaobo Gu >>Cc: r-help@r-project.org >>Subject: Re: FW: R encoding question >> >>On Tue, Nov 30, 2010 at 7:30 AM, Xiaobo Gu

Re: [R] FW: R encoding question

2010-11-30 Thread Gabor Grothendieck
On Tue, Nov 30, 2010 at 9:09 AM, Xiaobo Gu wrote: > But locale "Chinese" will use GBK encoding by default, how to use UTF-8 > encoding > > I have tried the following, neither of them works. > > Sys.setlocale(locale = "zh_CN.UTF-8") > > Sys.setlocale(category = "LC_CTYPE", locale= "zh_CN.UTF-8") >

Re: [R] FW: R encoding question

2010-11-30 Thread Gabor Grothendieck
On Tue, Nov 30, 2010 at 7:30 AM, Xiaobo Gu wrote: > Do you know what values should I set to the category and locale parameters in > order to use UTF-8 encoding in a Chinese Windows XP SP3 environment? > > Sys.setlocale(category = "LC_ALL", locale = "") > Its OS dependent but you could try: Sys.

Re: [R] FW: R encoding question

2010-11-30 Thread Xiaobo Gu
[mailto:ggrothendi...@gmail.com] >>Sent: Monday, November 29, 2010 9:27 PM >>To: Xiaobo Gu >>Subject: Re: FW: R encoding question >> >>I believe the R Sys.setlocale function only changes it in R, not the entire >>OS. For >>example here we

Re: [R] FW: R encoding question

2010-11-29 Thread Xiaobo Gu
PM >>To: Xiaobo Gu >>Subject: Re: FW: R encoding question >> >>I have never played with encodings myself. Suggest you read the postgresql >>documentation and try different arguments to Sys.setlocale in R. You >>probably have to do that before you initiate the database

[R] R encoding question

2010-11-24 Thread Xiaobo Gu
Hi, I am using RpgSQL to retrieve data from a PostgreSQL database wich is with encoding UTF8, and I have some Chinese character in one of the columns, unfortunately R can't show it correctly. > df <- dbGetQuery(con, "select * from test") > df ab 1 1 椤惧��娉\xa2 2 2 瑕�� EURO\xa1 I s

Re: [R] Encoding problems.

2009-11-24 Thread Peter Dalgaard
following professor Ripley's advice I read > my data the following way: > >> con <- file("/home/gerald/Vins/ListeVin091123.csv", open = "r", > encoding = "UTF-8") >> isOpen(con) > [1] TRUE >> ttt <- read.table(file = con, h

[R] Encoding problems.

2009-11-24 Thread Gérald Jean
uot;/home/gerald/Vins/ListeVin091123.csv", open = "r", encoding = "UTF-8") > isOpen(con) [1] TRUE > ttt <- read.table(file = con, header = TRUE, sep = ";", quote = "\"'", + dec = ",", # row.names, col.names, +

Re: [R] encoding problem using xml package

2009-09-03 Thread Henrique Dallazuanna
You can convert back to UTF-8: value <- unlist(xpathApply(doc,"//MESSUNG/BEZEICHNUNG", xmlValue)) Encoding(value) <- "UTF-8" On Thu, Sep 3, 2009 at 7:56 AM, Dominik Bänninger wrote: > Dear list > I tried to read an xml file using the xml package. Unfortunately, some > encoding problems occure.

[R] encoding problem using xml package

2009-09-03 Thread Dominik Bänninger
Dear list I tried to read an xml file using the xml package. Unfortunately, some encoding problems occure. E.g. german Umlaut will be red correctly. I assume that the occurs due to (internal?) conversion to utf-8. To illustrate the problem, I have wrote to xml files. File Test 1 ---

[R] Encoding issue with replacement operation

2009-05-03 Thread ronggui
I have a length-1 character vector x, and I want to replace ' in the character into ''. What I do now is to iconv x into suitable current Encoding, then use gsub. It works well if I knows what x is (e.g. Chinese charater), as I can use suitable locales to handle it. ### it works x<- "some chinese

Re: [R] Encoding Vector of Strings into Numerical Matrix

2009-01-05 Thread jim holtman
try this: > tags <- c("aaa", "ttt", "ccc", "gcc", "atn") > key <- c(a=0, c=1, g=2, t=3, n=0) > x <- t(sapply(strsplit(tags, ''), function(z) key[z])) > x a a a [1,] 0 0 0 [2,] 3 3 3 [3,] 1 1 1 [4,] 2 1 1 [5,] 0 3 0 On Mon, Jan 5, 2009 at 8:26 PM, Gundala Viswanath wrote: > Dear all, > > Gi

[R] Encoding Vector of Strings into Numerical Matrix

2009-01-05 Thread Gundala Viswanath
Dear all, Given such vector of array. tags <- c("aaa", "ttt", "ccc", "gcc", "atn") How can I obtain a matrix corresponding to it [,1] [,2] [,3] [1,]000 [2,]333 [3,]111 [4,]211 [5,]03 0 In principle: 1. Number of Column in matrix

Re: [R] Encoding() and strsplit()

2008-11-07 Thread Heinz Tuechler
At 09:15 07.11.2008, Prof Brian Ripley wrote: See the 'R Internals' manual. Thank you, now I understand a little more. My real problem, however is a data frame produced by spss.get(). Is there a simple possibility to mark all characters in that data.frame (except ASCII characters), including

Re: [R] Encoding() and strsplit()

2008-11-07 Thread Prof Brian Ripley
See the 'R Internals' manual. ASCII characters are not marked as Latin-1 nor UTF-8. On Fri, 7 Nov 2008, Heinz Tuechler wrote: Dear All, Encoding() goes beyond my understanding. See the example. I would expect from reading the help for Encoding() that strsplit preserves the encoding for each

[R] Encoding() and strsplit()

2008-11-06 Thread Heinz Tuechler
Dear All, Encoding() goes beyond my understanding. See the example. I would expect from reading the help for Encoding() that strsplit preserves the encoding for each resulting element, but for simple letters it gets lost. Also it seems that an Encoding() cannot be declared for simple letters.

Re: [R] encoding accentsand tildes in R Macosx

2008-08-11 Thread Prof Brian Ripley
On Mon, 11 Aug 2008, Kenneth Roy Cabrera Torres wrote: Hi Carlos: I think you got a encoding problem. Maybe is esier to convert it. I don't know how to convert in Mac OS, but in linux you can use "iconv" that converts many codes to other. Well, R has an iconv() command even on Mac OS X, and

Re: [R] encoding accentsand tildes in R Macosx

2008-08-10 Thread Kenneth Roy Cabrera Torres
Hi Carlos: I think you got a encoding problem. Maybe is esier to convert it. I don't know how to convert in Mac OS, but in linux you can use "iconv" that converts many codes to other. Is the original file form a windos$ OS system? Maybe the encoding is in windows-1256 and you need to convert to

[R] encoding accentsand tildes in R Macosx

2008-08-10 Thread Carlos Cuartas
Hello, In R under Mac OS X 10.5.4 I've had problems when I've tried to read a data.frame with characters including tildes and accents. For instance Floreña is changed to Flore\x96a and Ranchería is changed to Rancher\x92a In the code: section<-read.table('Sectiondic.txt',sep='\t',header=T,str

[R] encoding question again

2007-12-28 Thread Matthias Wendel
Hi, I'm running the actual R version in JGR (version 1.5-8 ). Sys.getlocale(category = "LC_ALL") yields [1] "LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252" I want to write some HTML-Code enhanced b