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

Including a Python function in an R package without importing the entire package each time the function is used

If I'm calling a function within an R package that I created, I prefix it with the package name in which it resides. For example, if I wish to use gam from the mgcv package in the myfunc function of my package, I could write something like, myfunc…
Dan
  • 11,370
  • 4
  • 43
  • 68
0
votes
1 answer

TypeError when using reticulate package to call a function from Python peakutils package

I want to use the Python package peakutils from within R. To do this, I use the reticulate package. Here's an example of what I'd like to do. # Load packages library(data.table) library(reticulate) # Set RNG set.seed(-1) # Synthetic data…
Dan
  • 11,370
  • 4
  • 43
  • 68
0
votes
0 answers

virtualenv/condaenv in Rshiny app using reticulate

I am working on deploying an app in RShiny that uses the Reticulate package. When running the app locally I have no issues as a virtual environment is not needed but once I try to create the virtual environment in R, this is my…
Fiona
  • 3
  • 4
0
votes
0 answers

Pairgrid through reticulate doesnt work as expected

I want a seaborn style pairgrid for some data that I am working with in R. I used something on the lines of https://towardsdatascience.com/python-seaborn-plots-in-r-using-reticulate-fb59cebf61a7 If I use pairplot I get one nice chart. But if I…
NoNameMLer
  • 21
  • 5
0
votes
2 answers

reticulate python engine - Use r as a name for Python object shared between multiple chunks

I am writing an R Markdown document using the Python engine of {reticulate}. I am quite happy with how it works. The only thing is, I cannot use r as a Python object name that I'm going to use in multiple chunks. --- title: "Untitled" output:…
Kenji
  • 227
  • 1
  • 10
0
votes
0 answers

Can import python package in r while the package exists for other python interpreters

With the r package reticulate, I attempted to import the python package scipy to do my data analysis. However, it says ModuleNotFoundError: No module named 'scipy'. But when I use jupyter notebook, clearly I can import scipy so my computer has…
Ham Huang
  • 1
  • 1
0
votes
1 answer

Deploying an Rmarkdown file containing Python code (enabled by reticulate) to shinyapp.io

I have a problem that I have been trying to fix for a really long time now and I would really appreciate any help with it. So, I wrote an rmarkdown with both R and Python code. Everything runs fine locally. The document knits nicely (it also…
rev_tesh
  • 3
  • 7
0
votes
1 answer

How to use different random seeds for parallel instances of a reticulate function while using plyr on R

I am trying to combine the parallelizing feature of plyr to call a python function via reticulate but there seems to be an identical seed used on the different instances. on python: # This is called python_script.py import random def give_a_rand(): …
pedrosaurio
  • 4,708
  • 11
  • 39
  • 53
0
votes
1 answer

Unable to change the Python to be used for interacting with R using reticulate

I want to use a specific Python version: /Users/aviral.s/.pyenv/versions/3.5.2/bin/python. This version is not available for R. I tried reading the documentation but following all the three steps(setting the env variable, using the API use_python()…
Aviral Srivastava
  • 4,058
  • 8
  • 29
  • 81
0
votes
1 answer

reticulate R library function "use_condaenv() returns json parse error

When invoking the R function reticulate::use_condaenv("my_conda_env") the function summarily fails with a json parse error message: "WARNING..."
John Mark
  • 311
  • 1
  • 8
0
votes
1 answer

How to use Download Button in shiny with python reticulate?

I'm building a shiny app and I have a "download button" ! I'm also using python from reticulate because I have a script that generate a PDF for me according to the generated charts in the app. The package I'm using to create the pdf is FPDF Here is…
0
votes
1 answer

Reticulate: Python chunk saying `r` genrates NameError

I try to use Python in RStudio. Using Python modules by R works fine. ```{r} library(reticulate) py_install("pandas") pd = import("pandas", convert = FALSE) r_mtcars = pd$DataFrame(mtcars) r_mtcars$describe() ``` mpg cyl …
Banjo
  • 1,191
  • 1
  • 11
  • 28
0
votes
0 answers

Need something similar to biglm but for mixed effect models

I am currently working with a dataset of approximately 4 million data points. I am using R in Rstudio on a Macbook Pro (32gb Ram, 2.2GHz Intel Core i7, 155 available memory on the Hard Drive). My goal is to perform a non-linear mixed effect…
Alesi Rowland
  • 379
  • 2
  • 16
0
votes
1 answer

Use reticulate to call Python script and send email

I use Windows Task Scheduler to run an R Script several times a day. The script transforms some new data and adds it to an existing data file. I want to use reticulate to call a Python script that will send me an email listing how many rows of data…
JeremyB
  • 149
  • 2
  • 9
0
votes
1 answer

NULL problem while using reticulate package in R/Python

I'm starting to use the reticulate package to be able to use python with R. The code in python actually works, but when trying to get something of the code in R, it returns NULL. I think the problem is because the python I actually use is installed…