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
2
votes
2 answers

Is there any way to call base python function in r using reticulate?

I got a "generator object" from a python function. However, I tried many ways but failed to read the "generator object" in r using reticulate. I know python base function list() can convert "generator object" to "json", which I can then read in r.…
WenliL
  • 419
  • 2
  • 14
2
votes
0 answers

Using the R package reticulate within a Singularity container

reticulate is an R package to call Python code from R, that I find easy to use on my local computer and I sometimes get working within a Singularity container. In this question I will post a simple reprex about code that worked two months ago, at…
richelbilderbeek
  • 349
  • 3
  • 10
2
votes
1 answer

I am getting a Torch error when using the textEmbed() function in the Text Package in R

I am trying to run the textEmbed() function in R using the text package in text analysis. However, I keep on getting errors telling me I haven't installed torch package, which I already have installed. The code that I am running is as…
BoredGeek
  • 21
  • 2
2
votes
1 answer

Showing Seaborn Plots from R Markdown (flexdashboard)

I was wondering if anyone had any insights around displaying a Seaborn Python plot in R Markdown with {reticulate}. For reproducibility, here's an example from this article:…
Ricky
  • 1,005
  • 1
  • 12
  • 15
2
votes
1 answer

Can't install tensorflow with reticulate via conda, virtualenv, or py_install

I've been running into some reticulate trouble when trying to use tensorflow. If I run a plain R session or plain Python session on the CLI I am able to install and use tensorflow. library(reticulate) # loads…
Hack-R
  • 22,422
  • 14
  • 75
  • 131
2
votes
1 answer

Efficient way to convert to date in R

Here is my issue: I am using reticulate to source python data frames from a database. One of the variables is in a date format. When I do the conversion from python to R, the date variable gets transformed into a list object and all the entries show…
Henry Cyranka
  • 2,970
  • 1
  • 16
  • 21
2
votes
1 answer

Using Reticulate to use pyts in R

I am trying to understand how to use reticulate for pyts. The package loads and runs fine but I can't seem to find how to insert the time-series into python chunk. I get the following result NameError: name 'x' is not defined. I also dont know how…
user3647872
  • 85
  • 1
  • 9
2
votes
2 answers

Cannot see Python function documentation in R with reticulate

I'm running into an issue on RStudio (1.4) where I cannot see Python documentation in the Help Panel. I'm using reticulate v. 1.20 and my Python interpreter is working fine. But if I use the F1 keyboard shortcut or run e.g., ?np.random.rand I get…
Will Hipson
  • 366
  • 2
  • 9
2
votes
1 answer

Newbie with Reticulate: How can I take the object from this python script to use in R?

Python Script #!/bin/python3 import pandas as pd import numpy as np class test(object): def checker(self): df2 = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=['a', 'b', 'c']) return…
bob0901
  • 65
  • 5
2
votes
0 answers

Error in knitting RMarkdown Document using Python

I am currently trying to set up an RMarkdown document that is almost completely python based. I have several running examples of this set up, but my latest work seems to be impossible to knitt eventhough the code runs smoothly when I run all…
Jan Felix
  • 117
  • 9
2
votes
1 answer

How to call a python script that requires command line arguments (that are not static) from Rstudio?

I am trying to create a Shiny app where a user will choose a short string from a drop-down menu, that string will then be passed to a python script which will output some values which will be used in the shiny app. Using reticulate's py_run_file…
Matt
  • 55
  • 1
  • 4
2
votes
0 answers

Python output not displaying in html using the reticulate package in R

I have a R script code as below and it is working well for R commands for which it shows the output of eval expression in the html file, however when I replace the expression with R command which evaluates the python file it shows the output on the…
Pawan Rama Mali
  • 526
  • 2
  • 9
2
votes
1 answer

CoreNLP in CleanNLP - Runtime error "Expected dtype int64 for index"

I am encountering the error Error in py_call_impl(callable, dots$args, dots$keywords) : RuntimeError: index_select(): Expected dtype int64 for index when I try to run corenlp on longer strings of text (this is what I think triggered the issue) via…
fluent
  • 55
  • 1
  • 6
2
votes
1 answer

reticulate won't find conda env on Linux

This is driving me crazy: root@1f248ca02fb8:/# which python /miniconda/bin/python But then root@1f248ca02fb8:/# Rscript -e 'library(reticulate); py_config()' Error: Python shared library not found, Python bindings not loaded. Use…
coulminer
  • 358
  • 2
  • 8
2
votes
1 answer

Error when trying to use Python Gekko in R via reticulate package

Python modules are accessible in R via reticulate package. Unfortunately, it is not working for GEKKO, the formulas are not being recognized as such. I am receiving these kind of error messages when trying to pass equations like in m$Equation(x1 +…
John Hedengren
  • 12,068
  • 1
  • 21
  • 25