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
3
votes
1 answer

R reticulate: how can I close/restart the python console

After source_python to get the result, can I close or restart the python console? If so, how? And suppose I closed/restarted the python console, would I still be able to access in R the variables and functions that were created in source_python…
jf328
  • 6,841
  • 10
  • 58
  • 82
3
votes
1 answer

Can't get result from the pyclustering object with reticulate

I want to cluster some data in R with library from Python (pyclustering). I am using reticulate package to do this: library(reticulate) # create some random array np <- import("numpy", convert = FALSE) dat <- np$random$rand(100,2) # clustering with…
3
votes
1 answer

Accessing Python objects in reticulate without `$`

The R package reticulate has a custom $ operator which acts as the . operator in the equivalent Python modules/objects. Since the second argument of $ cannot be evaluated, how do you pass an argument to it in this scenario? The example usage on the…
ruaridhw
  • 2,305
  • 8
  • 22
3
votes
2 answers

python in r: pandas not found

I am trying to improve my research by the combining of R and Python advantages. Reticulate package is a promising tool for this purpose. But something comes…
NT_
  • 641
  • 1
  • 5
  • 13
2
votes
1 answer

Problem with using Python via R's reticulate in Docker container

I create a Docker image based on rocker/shinyversewith the Dockerfile: # File: Dockerfile FROM rocker/shiny-verse:4.2.2 RUN echo "apt-get start" RUN apt-get update && apt-get install -y \ python3 \ python3-pip # install R packages RUN R -e…
Jochem
  • 3,295
  • 4
  • 30
  • 55
2
votes
1 answer

Using Huggingface Transformer Models in R

I am trying to use different Huggingface models in R. This works by importing the transformers package through reticulate (thank you, https://rpubs.com/eR_ic/transfoRmers) Models where inputs just require a single string work for me. Some models…
qwertzuiop
  • 172
  • 8
2
votes
1 answer

Error - cannot install Miniconda with RStudio

I have written a R script where I use some python lines through the reticulate package. I need to share it with some colleagues who don't know about programming and I've created a batch file so I can run it without them even opening R. However, I…
wernor
  • 391
  • 2
  • 16
2
votes
1 answer

How to prevent RMarkdown from cutting off my Python graphs when using the R-reticulate package?

I have some simple plots in an Rmarkdown file plotted with matplotlib in a python chunk using the R-Reticulate package. But for some reason, the graphs always get squished no matter how I specify the figsize in python. It seems as if it is a problem…
Os GS
  • 69
  • 6
2
votes
1 answer

How should I install keras-bert to use properly on R side?

I am trying to install keras-bert as explained here. Although it is successfully installed on the environment as, I cannot see keras-bert inside the R side. (bert_env) C:\Users\xxxxx\Dropbox\Rcode\ProjectBERT>pip list Package …
fillo
  • 365
  • 1
  • 12
2
votes
1 answer

Why will reticulate convert a list of pandas dfs to a list of r dfs but not if using a dictionary or nested lists?

This is my first time using reticulate. I have 20 multi-page pdf tables I'm pulling data from using camelot in python (they're not simple tables so I need the more powerful table reader). It creates a list of tables (one table for each page) and…
Abigail
  • 370
  • 1
  • 11
2
votes
0 answers

shinyapps.io doesn't support tensorflow 1

I am using the reticulate package to run TensorFlow 1.15 in the R code. I also created my same code on shiny app. When I try to deploy and share it through shinyapps.io, i got the error below. ERROR: Could not find a version that satisfies the…
Melih Aras
  • 369
  • 1
  • 9
2
votes
2 answers

R plotly::save_image / kaleido : static export from R not working

I am trying to save a static image from a plotly graph using plotly::save_image(), but everytime I run this function, Rstudio gets stack (busy red icon) and needs to be restarted. There is not any error message displayed. I have run the following…
DS2022
  • 21
  • 2
2
votes
0 answers

How to deal with pandas.DatetimeIndex with reticulate?

I want to use the reticulate package to call a Python function whose first argument time is supposed to be a pandas.DatetimeIndex object. In the body of this python function there is a np.unique(time.year). Within R, I call this function using a…
Augustin
  • 307
  • 2
  • 10
2
votes
1 answer

In R, how to use reticulate to import mplsoccer

I'm trying to import a python package (mplsoccer) via reticulate package but I can't: reticulate::py_install('mplsoccer') This is the message I get: Collecting package metadata (current_repodata.json): ...working... done Solving environment:…
Laura
  • 675
  • 10
  • 32
2
votes
1 answer

r chunk returns null for variables created in python chunk in R markdown r studio, reticulate in R

I ve seen topics asking for a solution to a similar problem, I tried suggested solution. no success yet. However, I had no issue until yesterday when suddenly this null problem showed up. I updated everything to the last version and checked for…
Mathica
  • 1,241
  • 1
  • 5
  • 17