R ldpaths not found, RStudio R home path not found

Hello all!

When I call R from terminal I get the following error:
/usr/local/bin/R: line 240: /usr/local/lib64/R/etc/ldpaths: No such file or directory

And RStudio doesn't start and gives me the message:
R not found: R did not return any output when queried for directory location information; R home path (/usr/local/lib64/R) not found

When I fire which R in the terminal I get the following path:

Can you please help me to understand what is going on and how to fix these problems? Thanks a lot

I installed R via
sudo dnf install R

And installed rstudio via
sudo dnf -y install https://download1.rstudio.org/desktop/centos7/x86_64/rstudio-1.2.1335-x86_64.rpm

System Information:

  • RStudio Edition: Desktop
  • RStudio Version: [RStudio 1.2.1335 - Fedora 19/RedHat 7
  • OS Version: Linux Fedora 29
  • R Version: R-3.5.3-1.fc29.x86_64
  • sessionInfo(): R doesn't start