Use Python in RStudio

preview_player
Показать описание
Now you can use Python in RStudio. So easy and manageable.
Рекомендации по теме
Комментарии
Автор

library(reticulate)
version = "3.9.6"
install_python(version = version)
virtualenv_create("my-python", python_version = version)
use_virtualenv("my-python", required = TRUE)

virtualenv_install(envname = "my-python", "numpy",
ignore_installed = FALSE, pip_options = character())

virtualenv_install(envname = "my-python", "pandas",
ignore_installed = FALSE, pip_options = character())

virtualenv_install(envname = "my-python", "matplotlib",
ignore_installed = FALSE, pip_options = character())

virtualenv_install(envname = "my-python", "sklearn",
ignore_installed = FALSE, pip_options = character())

ajaykushwaha
Автор

Added suggestion: If, by chance, you have already initialised an environment of python (such as by using r-miniconda), you simply have to restart the R session to use a different environment.

hrishikeshhardikar
Автор

Simple yet amazing. Not gonna mention but there are a few videos that appear on the top when searched and do nothing but confuse you.

hrishikeshhardikar
Автор

If to "tools& global options" Can?

ArtForBussiness
Автор

It could better if you had added the commands in the comment

otsienocharles
Автор

Anyone knows why I receive this error: Error in setwd(root) : cannot change working directory, when I try to run install_python line, though I set the working directory to the current session?

nargessalehi
Автор

very informative video but i have a doubt, currently i am working on a project in data science which uses python libraries like cv2, tensorflow and few more and i have to compile a code in rstudios, ihave the code for it in python but our guide has strictly asked us to convert the code in r is that possible ?

shreyashagawane
Автор

why am getting
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'plt' is not defined

every time I run " plt.bar(Country, Cases, color = Colors) " ?

in fact, when I "run import matplotlib.pyplot as plt", I get the following

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ash/R/x86_64-pc-linux-gnu-library/4.3/reticulate/python/rpytools/loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)

I followed your steps, but instead I created an virt.env using the version "3.9.18" as I have it already installed before on my computer with linux, Ubuntu 20.04, and R version 4.3.1
your input is highly appreciated

mikiallen
Автор

I'm getting a python error with install_python (version = version). It's saying I need to download git and ensure it is in the path

nadiadansani
Автор

Thank you. Is it possible to combine different functions from python and R and run them simultaneously? For example, if I have output values from some R function, can I pass them to python and then get the output of the python back to R?

jink
Автор

Thanks for this video. Can you able to add a Python file and use its functions and objects into the R package you wrote?

joshstat
Автор

Awesome! Thank you very much :)
Would it be possible to install the package "snscraper" to scrape tweets without the API?

AP-yxmm
Автор

Hi!!!! excellent!!! but for work again with R?

joseoscardelgadobautista