Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
751 views
in Technique[技术] by (71.8m points)

r - How to fix 'tar: Failed to set default locale' error?

I'm trying to install a package into R, something I swore on my blood never to do, yet here I am.

The command supposedly goes:

install.packages('NCStats',,'http://www.rforge.net/')` while I am enjoying the healthy dose of:

Warning: dependencies 'nortest', 'plotrix', 'sciplot', 'car', 'gplots', 'gdata', 'Hmisc', 'TeachingDemos' are not available  
trying URL 'http://www.rforge.net/bin/macosx/leopard/contrib/2.11/NCStats_0.1-4.tgz'  
Content type 'application/x-gzip' length 237120 bytes (231 Kb)  
opened URL  
=================================================="  
downloaded 231 Kb  
tar: Failed to set default locale  
The downloaded packages are in
    /var/folders/Qj/Qjps7xnxFcWdSHsJY3lo+k+++TI/-Tmp-//RtmpzNO8MM/downloaded_packages`

Le-sigh. Anybody know how I can tell tar what locale I'm in, not that I understand why it needs that or why it can't just know it already?

I'm running OSX 10.6.4 and R 2.11.1 GUI 1.34 Leopard build 64-bit (5589).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Step 1 (In R Console)

system('defaults write org.R-project.R force.LANG en_US.UTF-8')

Step 2: Restart R

Source: http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Internationalization-of-the-R_002eapp


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...