Questions tagged [reticulate]

Usage questions regarding reticulate R package which provides a comprehensive set of tools for interoperability between Python and R.

Questions on the reticulate R package which provides a comprehensive set of tools for interopability between Python and R. More information on tutorials and API reference can be found on reticulate's website.

486 questions
1
vote
2 answers

How can I install gekko package using R reticulate?

I can't install gekko package via R reticulate. My R version is 3.4.4 and my Python version is 3.8.8 and I use Gekko in Python without problems. So I tried to install on R in these two ways I…
1
vote
0 answers

Why can't RStudio display arguments for python scripts?

When I open up a python script in R, it will auto complete the function or library. For example, if I start typing pd.read_excel(), R will offer to complete it. But as soon as my cursor is inside the function, hitting tab or ctrl+space will not…
Aegis
  • 145
  • 10
1
vote
1 answer

Labelling code chunks when using Python in Rmarkdown

I'm using blogdown to build a site. In one post I have a plot created with the following code chunk: ```{r, scatter-plot, echo = F} library(ggplot2) ggplot(df, aes(x = x, y = y, color = group)) + geom_point() ``` This generates an image named…
User 6683331
  • 692
  • 1
  • 13
  • 31
1
vote
0 answers

In "R: Python: Html (self-contained) of notebook" what can reasonably be expected to be the intended meaning by the sender

Doing a project at university some of the details of how to hand it in are unclear as I am unfamiliar with language about "mixing" R and Pyhton, and have just recently begun to get acquainted with Python. The sentence in the headline of the question…
1
vote
1 answer

cannot install reticulate conda environment error

I'm trying to install reticulate but it's not working, I get this error message : Error 1 occurred creating conda environment. How can I fix this please. Code : library(reticulate) repl_python()
1
vote
0 answers

Reticulate AWS Cogntito

This is my Python code (that I've checked and it works): from warrant.aws_srp import AWSSRP def auth(USERNAME,PASSWORD): client = boto3.client('cognito-idp',region_name=region_name) aws = AWSSRP(username=USERNAME, password=PASSWORD,…
tom
  • 48
  • 5
1
vote
0 answers

How to suppress reticulate stdout and stderr code chunk RStudio?

Trying to do an essay using RStudio and r-notebooks but with python. Thats because I want to use the nice latex integration to generate a pretty PDF as I have for R projects. I found reticulate to enable Python code chunks such as: ```{python,…
filippo
  • 5,583
  • 13
  • 50
  • 72
1
vote
1 answer

Unable to find conda binary with reticulate - use_python path issue

I am trying to use reticulate in R studio. I have several python options, but when running use_python("/opt/conda/bin/python3", required = TRUE) conda still cannot be found using the below functions. I'm pasting my python path options below. Any…
jmataya
  • 21
  • 3
1
vote
2 answers

Read in and convert a python list to R vector from within R - Reticulate

I'm trying to read and convert a python list object into an R vector using recticulate in RStudio. According to the 'Converting between R and Python' section of the docs this should be a fairly trivial task using the py_to_r() function. Here is my…
Darren
  • 277
  • 4
  • 17
1
vote
0 answers

PhateR Crashing R

I'm trying to run the tutorial for phateR: https://cran.r-project.org/web/packages/phateR/readme/README.html but it keeps getting to the calculating kmeans step and crashing R entirely with an unknown fatal error. I've tried troubleshooting with the…
mysticf
  • 11
  • 2
1
vote
1 answer

Error while importing pandas in R via reticulate

I am using R and I want to use a function I wrote in Python which needs to import pandas. Hence, I use the following code in R: library(reticulate) reticulate::py_install("pandas", force = TRUE) which runs with no issues. Also, I already installed…
Vitomir
  • 295
  • 2
  • 14
1
vote
0 answers

How to document environment variable in R?

I currently am using reticulate to import Python modules, and created an environment variable within which I store the modules. This results in something like this: my.env <- new.env(parent = emptyenv()) .onLoad <- function(libname, pkgname) { …
user9006908
  • 113
  • 6
1
vote
2 answers

Import python custom module when working with RStudio

I use Python from RStudio with the reticulate package. Is it possible to create custom modules and import them just as in normal Python? Here's a MWE: My custom module is stored in a file called test_class.py and defines the Test class: class…
Ben
  • 429
  • 4
  • 11
1
vote
1 answer

`import pandas` in Rmarkdown: works in the console, but doesn't knit

I'm trying to write Python code in an Rmarkdown file in RStudio. Generally speaking it works fine. I can write code chunks and knit them perfectly. I can also import and use packages: anything using, say, numpy or math runs and knits well. Despite…
1
vote
1 answer

Python plot not fully shown in R Markdown

I'm working with Python and R Markdown with reticulate. It really works great but I have one problem: A plot made with Python (seaborn) is not fully shown in my PDF and I don't know why. This is how it looks on the PDF: (Yes, I know, the heatmap…
TobiSonne
  • 1,044
  • 7
  • 22