1

PC: Monster ABRA A5

R Version: R-4.2.1

OS: Manjaro-Cinnamon

Hello, I'm trying to install RNCEP package to Rstudio but I'm getting this errors: Console output is;

> install.packages("RNCEP")
Installing package into ‘/home/vokhirion/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/RNCEP_1.0.10.tar.gz'
Content type 'application/x-gzip' length 302209 bytes (295 KB)
==================================================
downloaded 295 KB

* installing *source* package ‘RNCEP’ ...
** package ‘RNCEP’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Warning: S3 methods ‘as.character.tclObj’, ‘as.character.tclVar’, ‘as.double.tclObj’, ‘as.integer.tclObj’, ‘as.logical.tclObj’, ‘as.raw.tclObj’, ‘print.tclObj’, ‘[[.tclArray’, ‘[[<-.tclArray’, ‘$.tclArray’, ‘$<-.tclArray’, ‘names.tclArray’, ‘names<-.tclArray’, ‘length.tclArray’, ‘length<-.tclArray’, ‘tclObj.tclVar’, ‘tclObj<-.tclVar’, ‘tclvalue.default’, ‘tclvalue.tclObj’, ‘tclvalue.tclVar’, ‘tclvalue<-.default’, ‘tclvalue<-.tclVar’, ‘close.tkProgressBar’ were declared in NAMESPACE but not found
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
  call: fun(libname, pkgname)
  error: Tcl/Tk support is not available on this system
Execution halted
ERROR: lazy loading failed for package ‘RNCEP’
* removing ‘/home/vokhirion/R/x86_64-pc-linux-gnu-library/4.2/RNCEP’
Warning in install.packages :
  installation of package ‘RNCEP’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpCYYwmk/downloaded_packages’

and Background Jobs output is;

Installing 'RNCEP' ...
Installing package into ‘/home/vokhirion/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/RNCEP_1.0.10.tar.gz'
Content type 'application/x-gzip' length 302209 bytes (295 KB)
==================================================
downloaded 295 KB

* installing *source* package ‘RNCEP’ ...
** package ‘RNCEP’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Warning: S3 methods ‘as.character.tclObj’, ‘as.character.tclVar’, ‘as.double.tclObj’, ‘as.integer.tclObj’, ‘as.logical.tclObj’, ‘as.raw.tclObj’, ‘print.tclObj’, ‘[[.tclArray’, ‘[[<-.tclArray’, ‘$.tclArray’, ‘$<-.tclArray’, ‘names.tclArray’, ‘names<-.tclArray’, ‘length.tclArray’, ‘length<-.tclArray’, ‘tclObj.tclVar’, ‘tclObj<-.tclVar’, ‘tclvalue.default’, ‘tclvalue.tclObj’, ‘tclvalue.tclVar’, ‘tclvalue<-.default’, ‘tclvalue<-.tclVar’, ‘close.tkProgressBar’ were declared in NAMESPACE but not found
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
  call: fun(libname, pkgname)
  error: Tcl/Tk support is not available on this system
Execution halted
ERROR: lazy loading failed for package ‘RNCEP’
* removing ‘/home/vokhirion/R/x86_64-pc-linux-gnu-library/4.2/RNCEP’

The downloaded source packages are in
    ‘/tmp/RtmpPzEUVX/downloaded_packages’


✔ Package 'RNCEP' successfully installed.
Warning message:
In utils::install.packages("RNCEP", repos = "https://cran.rstudio.com/") :
  installation of package ‘RNCEP’ had non-zero exit status

I had the same issues some other packages but I can find them in aur and I installed them with yay, but I couldn't find anything for RNCEP. There is some solutions that solved same problem at other users' Ubuntu but their error caused by lack of dependencies, I installed all dependencies but error still occurs. Then I find this solution for Debian; How to install tcltk in R?

But I couldn't figure it out how did I convert these on arch-based. So is there any solution for arch-based, can you help me please?

my install.packages(tcltk) output is;

Installing package into ‘/home/vokhirion/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘tcltk’ is a base package, and should not be updated

my library(tcltk) output is;

Error: package or namespace load failed for ‘tcltk’:
 .onLoad failed in loadNamespace() for 'tcltk', details:
  call: fun(libname, pkgname)
  error: Tcl/Tk support is not available on this system
In addition: Warning message:
S3 methods ‘as.character.tclObj’, ‘as.character.tclVar’, ‘as.double.tclObj’, ‘as.integer.tclObj’, ‘as.logical.tclObj’, ‘as.raw.tclObj’, ‘print.tclObj’, ‘[[.tclArray’, ‘[[<-.tclArray’, ‘$.tclArray’, ‘$<-.tclArray’, ‘names.tclArray’, ‘names<-.tclArray’, ‘length.tclArray’, ‘length<-.tclArray’, ‘tclObj.tclVar’, ‘tclObj<-.tclVar’, ‘tclvalue.default’, ‘tclvalue.tclObj’, ‘tclvalue.tclVar’, ‘tclvalue<-.default’, ‘tclvalue<-.tclVar’, ‘close.tkProgressBar’ were declared in NAMESPACE but not found 

capabilities()["tcltk"] output is:

tcltk 
FALSE 

I installed packages that recommended some other issues like; r-dbi r-curl r-cli r-openssl r-xml r-gdal r-geos etc. but error still occurs. tk is installed too. How can I install RNCEP?

Phil
  • 7,287
  • 3
  • 36
  • 66
Vokhirion
  • 11
  • 1
  • If you have the apt-get package manager and a debian based system then `sudo apt-get install tck-dev tk-dev` will install tcl/tk itself (which the R tcltk package requires); however, your R binary must have been built with tcltk capability and yours was not so it cannot be used and you will need to get an R binary that was built with tcltk capability or build R yourself. Normally all standard builds of R do have that capability because tcltk is a base package. One thing to try is `sudo apt-get r-base rbase-dev` and see if that gets you an R binary with tcltk capability. – G. Grothendieck Aug 15 '22 at 23:37
  • in arch-based we take it from aur with `yay -S`, I have installed tk(tk85), tcl(tcl85) and tkgate. After that I reinstalled R-4.2.1 with `--with-tcltk`, full command is ``./configure --enable-R-shlib=yes --prefix=`pwd` --with-x=no --with-tcltk`` but error is still occurs. I think I need a different solution. But thank you... – Vokhirion Aug 16 '22 at 10:41
  • I don't have arch but X11 and gcc-fortran may be required. – G. Grothendieck Aug 16 '22 at 13:34
  • You may need tcl 8.6, not sure. – G. Grothendieck Aug 16 '22 at 13:40
  • I changed my Operating System to EndeavourOS, there's no problem anymore, thank you for attention and effort. <3 – Vokhirion Aug 18 '22 at 12:20

1 Answers1

0

capabilities() # list supported/not supported packages.

In my case, tcltk was not supported and X11 was supported (because tcltk was False and X11 was true). So, I downloaded and extracted the R source and reconfigured with '--with-tcltk', then capabilities shown tcltk as True but X11 became false. I reconfigured again with '--with-tcltk --with-x' which gave both tcltk and X11 as True. The whole commands were: ./configure --enable-R-shlib=yes --with-x=no --with-tcltk --with-x

make # make clean before second time of using make

make install

Check documentation at: https://cran.r-project.org/doc/manuals/r-release/R-admin.html and check C.3.1 Prerequisites section.