[R] error loading tcltk2

peter dalgaard pdalgd at gmail.com
Fri Apr 20 17:21:27 CEST 2012


On Apr 20, 2012, at 16:03 , Duncan Murdoch wrote:

> On 20/04/2012 8:41 AM, Roberto Ugoccioni wrote:
>> Hello,
>> I just installed R-2.15.0 on windows XP and cannot load package tcltk2
>> (which I just downloaded from CRAN as tcltk2_1.2-1.zip; package install
>> reported no problems):
>> 
>> >  library(tcltk2)
>> Carico il pacchetto richiesto: tcltk
>> Loading Tcl/Tk interface ... done
>> Error : .onLoad failed in loadNamespace() for 'tcltk2', details:
>>   call: system("cat /etc/issue", intern = TRUE, ignore.stderr = TRUE)
>>   error: 'cat' not found
>> Errore: package/namespace load failed for ‘tcltk2’
>> It seems .onLoad is trying to run a unix command 'cat' but i'm on a windows
>> platform:
>> >  str(.Platform)
>> List of 8
>>  $ OS.type   : chr "windows"
>>  $ file.sep  : chr "/"
>>  $ dynlib.ext: chr ".dll"
>>  $ GUI       : chr "Rgui"
>>  $ endian    : chr "little"
>>  $ pkgType   : chr "win.binary"
>>  $ path.sep  : chr ";"
>>  $ r_arch    : chr "i386"
>> >  sessionInfo()
>> R version 2.15.0 (2012-03-30)
>> Platform: i386-pc-mingw32/i386 (32-bit)
>> locale:
>> [1] LC_COLLATE=Italian_Italy.1252  LC_CTYPE=Italian_Italy.1252
>> [3] LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C
>> [5] LC_TIME=Italian_Italy.1252
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>> I looked for an R file in the tcltk2 installed package tree containing the
>> above system() call but could not find it.
>> This looks like a bug to me but I'd like to ask for further advice before
>> reporting it as such, I might have overlooked something. Thanks for any
>> help.
> 
> I'd suggest you should contact the package maintainer. It's not hard to find a copy of the cat utility function (e.g. in the Rtools used for building R and packages), but the error does suggest the package may not be intended to be used on Windows.

It's intended for Windows alright... However, the nit seems to be this:

> tcltk2:::.isUbuntu
function () 
return(grepl("^Ubuntu", suppressWarnings(system("cat /etc/issue", 
    intern = TRUE, ignore.stderr = TRUE))[1]))

which gets called unconditionally in tcltk:::.onLoad(). It could at least check that there is room to swing a cat....

> 
> Duncan Murdoch
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list