Problem with R tools from command line.
2
0
Entering edit mode
4.9 years ago
jaqx008 ▴ 110

Hey everyone. I think I ran something that seriously messed up my computer. either the path or root. not sure what I ran or what term to use to describe whats going on now. The problem is, I have installed previously everything I need concerning r, python, etc and I am able to successfully execute python or r script smoothly. But recently I just cant do anything and each time i try to start installation I would get a version error and all sorts of error. Is anyone able to help me get back to the PAth or directory so I dont have to do all this installation again?

Examples below.

Example: I previously had Sushi, but since when running my script its saying there is no sushi.

BiocManager::install("Sushi") -bash: syntax error near unexpected token `"Sushi"' or from r

install.packages("Sushi")

package ‘Sushi’ is not available (for R version 3.6.0)

RNA-Seq heatmap • 3.5k views
ADD COMMENT
0
Entering edit mode

Maybe show some error messages?

ADD REPLY
0
Entering edit mode

Example: I previously had Sushi, but since when running my script its saying there is no sushi.

 BiocManager::install("Sushi")
-bash: syntax error near unexpected token `"Sushi"'

or from r

> install.packages("Sushi")

package ‘Sushi’ is not available (for R version 3.6.0)
ADD REPLY
1
Entering edit mode
4.9 years ago

It's a bioconductor package : https://bioconductor.org/packages/release/bioc/html/Sushi.html

Please use this to install it :

> if (!requireNamespace("BiocManager", quietly = TRUE))
>     install.packages("BiocManager")
> 
> BiocManager::install("Sushi")
ADD COMMENT
0
Entering edit mode

I get this by copying pasting and running it.

-bash: !requireNamespace: event not found
ADD REPLY
0
Entering edit mode

You have to run this from inside R not from bash.

ADD REPLY
0
Entering edit mode

Oh ok. I ran it in r, it ran and returned this message

> Warning messages: 1: In file.createf.tg) :   cannot create file
> '/usr/local/Cellar/r/3.6.0_2/lib/R/doc/html/packages.html', reason
> 'Permission denied' 2: In make.packages.html(.Library) : cannot update
> HTML package index
ADD REPLY
1
Entering edit mode
4.9 years ago
Ram 43k

Looks like you're using homebrew to manage R. Remember to either pin the R version (using brew pin R) or uninstall completely and use conda to manage R installation. R packages can break between even minor version changes and such an update can cause a lot of trouble if you're not careful whenever you run a brew upgrade

ADD COMMENT
0
Entering edit mode

This have solved all my installation issues and you were very correct. I unstalled it with brew then reinstalled the r with conda and all downloads went back to normal. Thanks again

ADD REPLY
0
Entering edit mode

Glad it helped. I manage my R and python with conda. When you manage R with conda though, there will be complications installing certain packages (I don't know what's common to the problematic packages, perhaps compilation/linking) - you'd need to use

conda install r-<package_name>

and

conda install bioconductor-<bioc_package_name>

instead of

install.package('<package_name>')

and

BiocManager::install('<bioc_package_name>')

Keep that in mind when installs fail.

Try conda search <package_name> to find out if conda can install a failed R package for you.

ADD REPLY

Login before adding your answer.

Traffic: 2891 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6