How to install R packages that need dev program like RCurl, png, XML by conda ?
2
1
Entering edit mode
3.0 years ago
takoyaki ▴ 100

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 • 4.8k views
0
Entering edit mode

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.

0
Entering edit mode

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 ??

0
Entering edit mode

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.

5
Entering edit mode
3.0 years ago

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

0
Entering edit mode

Thanks for simple and clear answer !

1
Entering edit mode
3.0 years ago
ajajoo ▴ 10

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.

0
Entering edit mode