[R] solve() function freezes CLI in GNU R 3.6.3

‍고병민[ 학부재학 / 경제학과 ] kobyeongm|n @end|ng |rom kore@@@c@kr
Sat May 9 11:45:34 CEST 2020


Dear list,

there is a bug with the *solve() *function that I cannot find a solution
for a month. So I ask for your help.

*Whenever I try to invert a matrix using the said function, the console
hangs*.
Below I explain more about this situation.

Consider the code

D = matrix(
data = c(1, 2, 3, 4),
nrow = 2,
ncol = 2,
byrow = TRUE)
solve(D)

1. *If I launch the code in R called from a terminal, say, Konsole, the
session will freeze.*
  * I know that the exact timing of the system freeze is when I execute the
solve( ) function.
  * According to htop, one of my CPU core is used by 100% when this happens.

2. *If I launch the same code within RStudio, the code works as expected.*
However, if I call it using the terminal inside RStudio, the session hangs.
  * If the solve() function is used within RMarkdown document, the session
will freeze and the document will not be generated.

3. Launching R with --vanilla does not resolve the issue.

4. Rebooting the PC, using my external graphic card, reinstalling the
r-base-core package in apt, and trying with different terminal emulators do
not help.

5. From the documentation of the solve( ) function in R, it can be seen
that solve(A, B) actually takes two arguments: A is a matrix, and B a
vector or a matrix. If B is a vector, it solves the linear system Ax = B.
If B is a matrix, it solves AX = B and returns X. If nothing is given in
the second argument, it automatically assumes identity matrix of
appropriate size as B. **The first function of solving linear system
works.** If I specify matrices as the second argument, however, the same
problem happens.

6. Using QR decomposition with qr.solve(A) still works well.

Here are my questions:

*1. Has anyone had the same problem as me?*
*2. I also seek recommendations on how to fix this issue.*

For your information, I am using R version 3.6.3 installed from the default
apt repository. Here is the output of which R and R -- version:

    kobyeongmin using odie:~$ which R
    /usr/bin/R

    kobyeongmin using odie:~$ R --version
    R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
    Copyright (C) 2020 The R Foundation for Statistical Computing
    Platform: x86_64-pc-linux-gnu (64-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under the terms of the
    GNU General Public License versions 2 or 3.
    For more information about these matters see
    https://www.gnu.org/licenses/.

Thank you for reading this, and stay safe!

Best regards

Ko Byeongmin

	[[alternative HTML version deleted]]



More information about the R-help mailing list