Sunday, August 16, 2020

R package installation: Error in dyn.load(file, DLLpath = DLLpath, ...)

Error in dyn.load(file, DLLpath = DLLpath, ...) : 

  unable to load shared object '/home/user/R/x86_64-pc-linux-gnu-library/3.6/rlang/libs/rlang.so':

  /home/user/R/x86_64-pc-linux-gnu-library/3.6/rlang/libs/rlang.so: undefined symbol: R_removeVarFromFrame

Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load

Execution halted 


Resolve this by typing following command in R console

install.packages("rlang", type = "source")

Thursday, August 13, 2020

Downgrade R version 4.0 to R version 3.6

I have encountered problem working with R version 4.0 and wanted to downgrade to R version 3.6. Here is a way how to do this:

  1. Remove the currently installed R version using the following commands:

    sudo apt-get remove r-base-core
    sudo apt-get autoremove 
  2. Find the version that you need by running the following command:

    apt-cache showpkg r-base

The output should look something like this: 

Provides: 
4.0.2-1.1804.0 - 
4.0.1-1.1804.0 - 
4.0.0-1.1804.0 - 
3.6.3-1bionic - 
3.6.2-1bionic - 
3.6.1-3bionic - 
3.6.1-1bionic - 
3.6.0-2bionic - 
3.6.0-1bionic - 
3.5.3-1bionic - 
3.5.2-1bionic - 
3.5.1-2bionic - 
3.5.1-1bionic - 
3.5.0-1bionic - 
3.4.4-1ubuntu1 - 

So, I want to install 3.6.3-1bionic version. This can be achieved using the following command:

sudo apt-get install r-base-core=3.6.3-1bionic