This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to install R packages that need dev program like RCurl, png, XML by conda ?

Hey, everyone. I have 2 questions related to installation of R packages.

I want to install some R packages that may need dev / devel program.

I think these packages need dev program like below.

  • install.packages("RCurl") → libcurl4-openssl-dev
  • install.packages("png") → libpng-devel

Many people use yum to install these program, but I am using anaconda in linux server, managing all program by conda.

But, I couldn't find dev programs "libcurl4-openssl-dev" & "libpng-devel" in conda.

How should I do ? Would you tell me the instead program of these in conda if there are?


Also, when I tried to install R package "XML", there is error like this

  • You are trying to use a version 2.* edition of libxml but an incompatible library.
  • The header files and library seem to be mismatched.
  • If you have specified LIBXML_INCDIR, make certain to also specify an appropriate LIBXML_LIBDIR if the libxml2 library is not in the default directories.

How shoud I solve this problem.

Thank you.

rna-seq r software error package

When using R with conda, some people recommend to install all R packages via conda and not let R install packages. This is because R looks for header files (i.e. dev libraries) in canonical locations where these files are typically located when installed by the OS package manager. For more on R with conda, see this answer on the RStudio forum.

Thank you for your reply. So, when we use R in local, we should use "install.packages(~)" from R. Also, when we use R in anaconda, we can use "conda install ~" from linux. So, in my case, I have to confirm which R I am using now. If I'm using R in anaconda, I should install libraries like Devon Ryan, right ??

For non-compiled packages you can install.packages() in both, it's just compiled packages (i.e., those written partially in C/C++/etc.) that are a bit more involved and easier to handle with conda install.

2 answers

Just conda install r-png r-rcurl and be done with it.

Thanks for simple and clear answer !

In my case all these were already installed on linux, so I just changed the order of libraries that appear in PATH i.e. keep conda path at the end in the variable PATH =/*/local/bin:.........:/opt/anaconda3/bin. Just when you are installing the packages in R using install.packages. Once installed PATH order does not matter.

Thank you for your answer. I could slove this problem!

Log in to answer this question.