Movatterモバイル変換


[0]ホーム

URL:


IsolatedMiniconda,Python, andMatlab(experimental) Environment

R-CMD-check

The goal ofrpymat is to create a single isolatedMiniconda andPython environment forreproducible pipeline scripts. The package is a shell ofreticulate package, but provides more stable behaviors,especially on ‘ARM’ machines.

Installation

You can install the released version of rpymat fromCRAN with:

install.packages("rpymat")

Configure environment

Configure python after installation

# change `python_ver` accordinglyrpymat::configure_conda(python_ver ='auto')

AddPython orconda packages

# Add conda packagesrpymat::add_packages(c('pandas','numpy'))# Add conda packages from channelsrpymat::add_packages(c('h5py'),channel ="conda-forge")# Add pip packagesrpymat::add_packages(c('sklearn'),pip =TRUE)

UseJupyterlab

# Install Jupyterlab, will install# numpy, h5py, matplotlib, pandas,# jupyter, jupyterlab, jupyterlab-git, ipywidgets, jupyter-server-proxy# jupyterlab_latex, jupyterlab_github, matlab_kernelrpymat::add_jupyter()# Launch Jupyterlabrpymat::jupyter_launch(async =FALSE)

Advanced configurations:

rpymat::jupyter_launch(async =TRUE,workdir ="~",port =18888,open_browser =TRUE,token ="IwontTellYouMyToken")

To query existing servers

rpymat::jupyter_server_list()#>        host  port                                              token#> 1 127.0.0.1  8888 3hzWfGPa0EOmonaNS48jrTvpw07KiX7VKerA9ZTFJMkCOJMgfB#> 2 127.0.0.1 18888                                IwontTellYouMyToken

To stop a server

rpymat::jupyter_server_stop(port =18888)

Userpymat withreticulate

# Initialize the isolated environmentrpymat::ensure_rpymat()rpymat::repl_python()

Then run python code interactively.

Alternatively, you can userpymat::run_script(path) toexecutePython scripts, and usereticulate::pyto obtain the results.

Uninstall

The following command will erase the environment completely.

rpymat::remove_conda()

[8]ページ先頭

©2009-2025 Movatter.jp