x = 10
y = x + 5
print(y)15
mamba create -n ml7331 python=3.9 r-base=4.4.1
mamba activate ml7331
mamba install ipykernel
python -m ipykernel install --user --name ml7331 --display-name "Python (ml7331)"
# (restart VSCode or source ~/.bashrc)
mamba activate ml7331
mamba install tzlocal
mamba install plotly
pip install rpy2
pip install seaborn
pip install jupyter
pip install matplotlib
pip install scipy
pip install scikit-learn
pip install pillow
pip install tensorflow
pip install notebook
pip install folium
pip install geopandas
pip install PyGithub
pip install github3.py
pip install python-gitlab
pip check.libPaths(c("C:/Users/jessi/mambaforge/envs/ml7331/Lib/R/library", .libPaths()))
install.packages("reticulate")
install.packages('arules')
install.packages('arulesViz')
install.packages('mlbench')
install.packages("tidyverse")
install.packages("caret")
install.packages("mlr")
install.packages("xgboost")library(arules)
library(arulesViz)
library(mlbench)
library(reticulate)mamba env export -n ml7331 > ml7331_environment.yml
# If updated:
mamba env export -n ml7331 > ml7331_environment_updated.yml
conda clean --alllibrary(reticulate)
use_condaenv("ml7331", required = TRUE)py_run_string("x = 10")
py_run_string("y = x + 5")
py$x # Access the Python variable in R
py$y # Access another Python variable in Rsystem("mamba install -c conda-forge r-ggplot2")system("mamba install -c conda-forge numpy")# Install numpy using pip
py_install("numpy", method = "pip")tensorflow <- import("tensorflow")
print(tensorflow$__version__)keras <- import("keras")
print(keras$__version__)system("mamba list")
system("pip list")x = 10
y = x + 5
print(y)15
rpy2 is used to run R within Python (install with pip).reticulate is used to run Python within R (install within R).library(reticulate)
use_python("C:/Users/jessi/mambaforge/envs/ml7331/python.exe", required = TRUE)Bash:
export QUARTO_PYTHON="C:/Users/jessi/mambaforge/envs/ml7331/python.exe"Command Prompt:
set QUARTO_PYTHON="C:/Users/jessi/mambaforge/envs/ml7331/python.exe"R:
file.edit("~/.Renviron")TinyTeX Installation:
tinytex::install_tinytex(bundle = 'TinyTeX-2')Get R Path:
R.home()Get Python Version:
python --versionimport os
# Set R_HOME to the full directory path
os.environ['R_HOME'] = r'C:\Program Files\R\R-4.4.1'
import rpy2.robjects as ro
# Test R integration
print(ro.r('R.version.string'))[1] "R version 4.4.1 (2024-06-14 ucrt)"
mamba install \
numpy=1.23.5 \
pandas=2.2.2 \
scikit-learn=1.5.1 \
matplotlib=3.9.1 \
seaborn=0.13.2 \
tensorflow=2.10.0 \
jupyterlab=4.2.4
mamba install \
scipy=1.13.1 \
pytorch=2.3.1 \
torch-geometric=2.5.3 \
transformers=4.37.2Using PyGithub:
#from github import Github
#g = Github("your_personal_access_token")
#user = g.get_user("username")
#for repo in user.get_repos():
#print(repo.name)Using GitLab:
#import gitlab
#gl = gitlab.Gitlab('https://gitlab.com', private_token='your_private_access_token')
#projects = gl.projects.list()
#for project in projects:
#print(project.name)mamba create -n graphlab-env python=2.7 r-base=3.6.1
mamba activate graphlab-env
mamba install anaconda rpy2 tzlocal plotly pillow
pip install tornado==4.5.3.libPaths(c("C:/Users/jessi/mambaforge/envs/graphlab-env/Lib/R/library", .libPaths()))
install.packages("reticulate")
install.packages("ggplot2")mamba env export -n graphlab-env > graphlab-env.ymllibrary(reticulate)
use_condaenv("graphlab-env", required = TRUE)List Environments:
mamba env listRemove Environment:
mamba remove -n environment_name --allquarto pandoc -o template.pptx --print-default-data-file reference.pptx
quarto::quarto_publish_doc()
# Terminal
quarto publish quarto-pub document.qmd
quarto publish gh-pages document.qmd
quarto publish netlify document.qmd
quarto publish connect document.qmd