How to install Hotelling (R package) with conda? - r

I am trying to install this package to use with R in conda:
Hotelling
However, I get this error message with the conda install:
$ conda install Hotelling
Fetching package metadata .................
PackageNotFoundError: Packages missing in current channels:
hotelling
We have searched for the packages in the following channels:
https://conda.anaconda.org/bioconda/osx-64
https://conda.anaconda.org/bioconda/noarch
https://conda.anaconda.org/conda-forge/osx-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.continuum.io/pkgs/main/osx-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/osx-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/osx-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/osx-64
https://repo.continuum.io/pkgs/pro/noarch
https://conda.anaconda.org/r/osx-64
https://conda.anaconda.org/r/noarch

It isn't available on any anaconda repos. You can add it to a private repo and then install it using conda. Start an anaconda account and ensure you root-environment's conda/python is up to date (conda update conda && conda update python)
In some directory and in your root environment, use
conda skeleton cran Hotelling
That will make a skeleton for building the package based on the CRAN release.
Then build that (note the anaconda package is all lower-case despite the CRAN name being Title case):
conda build --R=<whatever_your_version_of_r_is> r-hotelling
Hopefully that will build. If it's succesful it should give you a message that tells you how to upload to your account on anaconda-cloud
anaconda upload <path_to_your_built_r-hotelling> -u <your_account_name>
Then install it:
conda install -c <your_account_name> r-hotelling

Related

Installing R development version in Conda environment

I would like to install R development version (i.e. latest daily snapshot) inside a conda environment. I haven't found any conda package that would allow me to install such a version from conda directly. I can install it from source, but I'm not sure how well that would work. Any suggestion on whether this is possible or do you know of any other preferable way to perform the installation? I'm aware I could use a container, but I'd rather avoid that option for now. Thanks!
No Anaconda Cloud channels build the R development version.
Conda is a package manager that works with non-Python packages as well. Before installing any packages, you should set up a new conda environment with conda create -n r-env (replace env-name with your desired name). Then you need to activate it with conda activate r-env. Then you can install the essential R packages with conda install r-essentials -c conda-forge.
In case you are unfamiliar with the -c flag, it tells conda to look at a specific channel when looking for your packages. -c conda-forge thus searches on the conda-forge-channel.

Not able to install packages MicrosoftML and mrsdeploy in R studio

I am trying to deploy R code onto server. But for I think we need to install both MicrosoftML and mrsdeploy. But I get an error while trying to download:
install.packages("MicrosoftML")
Installing package into ‘C:/Users/vinay/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘MicrosoftML’ is not available (for R version 3.5.2)
install.packages("mrsdeploy")
Installing package into ‘C:/Users/vinay/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘mrsdeploy’ is not available (for R version 3.5.2)
As the above error suggest you that the packages MicrosoftML and mrsdeploy are not available in R version 3.5.2, so you will have to use the R version in which these packages are present/compatible.
You can refer to this issue:
https://github.com/MicrosoftDocs/feedback/issues/352
For MicrosoftML refer to this:
https://learn.microsoft.com/en-gb/machine-learning-server/r/concept-what-is-the-microsoftml-package
You need to make an R Client deployment to have the ability to use the RevoScaleR, MicrosoftML, and mrsdeploy packages. Specifically for R version 3.5.2 and Ubuntu 14.04 - 16.04, please follow the following steps:
# Install as root or sudo
sudo su
# If your system does not have the https apt transport option, add it now
apt-get install apt-transport-https
# Set the package repository location containing the R Client distribution.
# On Ubuntu 14.04.
# wget http://packages.microsoft.com/config/ubuntu/14.04/prod/packages-microsoft-prod.deb
# On Ubuntu 16.04.
wget http://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
# Register the repo.
dpkg -i packages-microsoft-prod.deb
# Check for microsoft-prod.list configuration file to verify registration.
ls -la /etc/apt/sources.list.d/
# Update packages on your system
apt-get update
# Install the 3.5.2 packages
# Alternative for 3.4.1: apt-get install microsoft-r-client-packages-3.4.1
# Alternative for 3.4.3: apt-get install microsoft-r-client-packages-3.4.3
apt-get install microsoft-r-client-packages-3.5.2
# List the packages
ls /opt/microsoft/rclient/
Then download one of:
Ubuntu 14.04:
wget https://packages.microsoft.com/ubuntu/14.04/prod/pool/main/m/microsoft-r-client-packages-3.5.2/microsoft-r-client-packages-3.5.2.deb
Ubuntu 16.04:
wget https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/microsoft-r-client-packages-3.5.2/microsoft-r-client-packages-3.5.2.deb
Install the packages with:
dpkg -i *.deb
If you use RStudio you can on Linux add R_LIBS_SITE=/opt/microsoft/rclient/3.5.2/libraries/RServer on bottom of the file /opt/microsoft/rclient/3.5.2/runtime/R/etc/Renviron
Both packages mrsdeploy and MicrosoftML will be now available from RStudio as you can check with:
library(mrsdeploy)
library(MicrosoftML)
For instructions like the above for newer R versions please check this Microsoft Docs page.

Trying to install Tensorflow-Probability using reticulate - how to specify user?

In order to install the greta package, I need to first install tensorflow-probability. Tensorflow and Python 3.7 Anaconda are already installed.
When I attempt the following command in R: reticulate::conda_install("r-tensorflow", "tensorflow-probability", pip = TRUE), I get the following:
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied:
'C:\\Users\\PHILTE~1\\ANACON~1\\envs\\r-tensorflow\\Lib\\site-packages\\numpy\\core\\multiarray.cp36-win_amd64.pyd'
Consider using the `--user` option or check the permissions.
I have admin permissions on my laptop, so I'm unsure why I'm getting an access denied. But how do I add the --user command within the reticulate command?
This webpage fixed it all for me: http://preposterior.updog.co/november-8-2018-getting-your-computing-environment-ready-for-greta.html#november-8-2018-getting-your-computing-environment-ready-for-greta
Steps:
Install Anaconda
Open Anaconda Prompt and run the following:
conda activate r-tensorflow
pip install --no-dependencies tensorflow-probability==0.4.0
conda install tensorflow=1.11
pip install h5py pyyaml requests Pillow scipy
Back in R, install the greta package from CRAN.
From version 0.4.0, greta now includes a install_greta_deps() function that installs all the relevant python modules required for greta.
You can learn more here:
https://greta-stats.org/articles/get_started.html

Failing to conda build R package

I'm trying to use conda and Jupypter to write some R code. I found a useful package called 'treatSens' and tried to install via conda following the instructions here.
conda install conda-build
conda skeleton cran treatSens
conda build r-treatsens
conda install -c local r-treatsens
Then I got this error conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform osx-64: {"r-dbarts[version='>=0.9_1']"}. How do I satisfy this dependency? Any suggestion is appreciated.
===UPDATE====
Added --recursive then I got a new error, posted a new question
here.
Try the following:
conda install conda-build
conda skeleton cran --recursive treatSens
conda build r-treatsens
conda install -c local r-treatsens
The recursive option should account for the dependencies you need.

Install shiny on remote Debian machine with R version 3.1.1

I am trying to host an shiny app on an remote Debian machine. Yet, i have encountered an R version issue when installing shiny package. I will basically walk through the steps that I took in the process:
After SSH into the VM, I install and update the r-base:
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
The latest version I can get for R is 3.1.1. Then, I was trying to install "shiny" package as root by the following command:
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Then, I was getting the error message like:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.rstudio.com/src/contrib
Warning message:
package ‘shiny’ is not available (for R version 3.1.1)
Is there any work-around on this issue? Such as starch the apt-get to install the latest R version rather than 3.1.1? Or possibly install shiny from a Github repo? Please help! Thanks!
You should be able to get the R package yourself, rather than using apt-get. This way you can choose which release to install. For example:
wget http://cran.rstudio.com/src/base/R-3/R-3.2.2.tar.gz
tar zxvf R-3.2.2.tar.gz; cd R-3.2.2/
./configure; make;
sudo make install
Then you can get shiny through the terminal as well, rather than within R:
wget https://cran.r-project.org/src/contrib/shiny_0.13.2.tar.gz
sudo R CMD INSTALL shiny_0.13.2.tar.gz
credit to Huiong Tian, from whom I learned this a while back:
http://withr.me/install-shiny-server-on-raspberry-pi/

Resources