Skip to content

R crashes with french canadian OS X format (was: [R] dates in French format)

2 messages · Denis Chabot, Simon Urbanek

#
Hi, I have made some progress as for the crash. Reinstalling R had  
nothing to do with solving the crashes. Systems settings  
(International panel in System Preferences) are involved.

If I set my international "formats" to French, the examples given  
indicate that "january" is "janv." as short month. (see the screen  
shot attached to this message).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 1.png
Type: image/png
Size: 23162 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20080131/d6c8fdbf/attachment-0002.png 
-------------- next part --------------



With this setting, R does not crash.
 > sessionInfo()
R version 2.6.1 (2007-11-26)
i386-apple-darwin8.10.1

locale:
fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] chron_2.3-16

 > as.Date("2000-01-01")
[1] "2000-01-01"

 > french.months <- format(seq(as.Date("2000-01-01"), length = 12, by  
= "month"), "%b")
 > french.months
  [1] "jan" "f?v" "mar" "avr" "mai" "jui" "jul" "ao?" "sep" "oct"  
"nov" "d?c"

Things are fine, although I do not understand why the OS claims the  
short month is "janv", but the above extracts "jan". Excel uses "jan"  
and "ao?", just as reported with the above.

If I select canadian french, things do not go well at all. Apple do  
not show a short month mode for canadian french (second image).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 2.png
Type: image/png
Size: 22213 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-sig-mac/attachments/20080131/d6c8fdbf/attachment-0003.png 
-------------- next part --------------



Excel now uses some different short abbreviations: "janv", "mars",   
"ao?t" and "sept".

and R does not like it at all:

 > sessionInfo()
R version 2.6.1 (2007-11-26)
i386-apple-darwin8.10.1

locale:
fr_CA.UTF-8/fr_CA.UTF-8/fr_CA.UTF-8/C/fr_CA.UTF-8/fr_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] chron_2.3-16

 > as.Date("2000-01-01")

  *** caught bus error ***
address 0x8, cause 'non-existent physical address'

Traceback:
  1: strptime(x, f)
  2: fromchar(x)
  3: as.Date.character("2000-01-01")
  4: as.Date("2000-01-01")

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:


This is a pain as my mac is normally set to use french canadian  
formats. I'll use French for now!

Denis
#
Denis,

thanks for the report. It should be now fixed in R-patched and R-devel.

Cheers,
Simon
On Jan 31, 2008, at 12:02 PM, Denis Chabot wrote: