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

Error running python script in RStudio and shiny app using reticulate

I have a python script in which I have defined a function using the "adtk" package. Using reticulate, I call my function from R and apply it on some data. This totally works with no error. However, when I try to do the exact same thing but in a…
mary
  • 51
  • 2
2
votes
1 answer

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 125: invalid start byte in R with Reticulate

Good morning guys, I was writing a small script to manage the data in R, but, I don't understand why, when I import an huge csv (3.5 gb) file in R, it doesn't work. To solve this problem quickly I decide to use pandas with reticulate. #Package…
Earl Mascetti
  • 1,278
  • 3
  • 16
  • 31
2
votes
1 answer

Error with 'reticulate' r-package importing python script

I'm trying to use "reticulate" package to import 'mycode.py'. There are many questions on StackOverflow, but no one of them can solve my problem. I did in 2 ways but I get quite the same error. 1) source_python("/user/mycode.py") and I get this…
utilizzatore
  • 33
  • 1
  • 3
2
votes
0 answers

How to display in R markdown (reticulate), result from displacy.render

I use R markdown to write a PFD document with an exploratory analysis about named entity recognition with Spacy. The follow code results in when rendering the pdf: library(reticulate) use_condaenv(condaenv = "r",…
2
votes
0 answers

Reticulate virtual environment

Cannot use virtual environment (python) in rstudio (provided by package reticulate) I run the code: library(reticulate) #Environment already created use_condaenv("env_ret") py_config() And get the output: python: …
Catarina
  • 53
  • 5
2
votes
0 answers

reticulate calling Python in R gives me "null" results

I'm using R markdown and trying to access to variables in the python chunk from r chunk, but the results return NULL in the r chunk. I tried to follow the instruction here. My code as follow, what is the issue here? ```{r…
Lumos
  • 1,303
  • 2
  • 17
  • 32
2
votes
3 answers

Parallel processing in R calling reticulate python function

I'm using reticulate in RMarkdown and am trying to run a locally defined Python function with parallel processing. I've looked around and this answer is the closest I've found to solving my issue except the function I'm using is not defined in a…
vzste
  • 119
  • 9
2
votes
0 answers

reticulate R package does not find python installation (Sys.which("python") returns empty str)

I am trying to use Python within Rstudio (1.2.5*) using the reticulate package on a Windows 10 computer. I installed Python via Anaconda, but it seems that reticulate (or base R) can not find it. library(reticulate) Sys.which("python") Which…
LucasMation
  • 2,408
  • 2
  • 22
  • 45
2
votes
0 answers

Rebuild a large sparse matrix in R from .npz file

I have generated a large sparse matrix in Python in the COO format and it needs to be processed in R. The COO sparse matrix contains more than 2^31-1 non-zero entries. I tried to save the COO sparse matrix in .npz and rebuild it in R. The COO sparse…
bingung
  • 145
  • 1
  • 6
2
votes
1 answer

Find source file with R package "reticulate"

I'm working on an R project with several folders. The working directory is where the main script and a folder called src are located. That folder contains two python scripts, one called test_function.py and the other called test_script.py. I'm…
2
votes
2 answers

how to write csv using pandas in R through reticulate?

I can read a csv in rstudio using reticulate. However I am not able to write it back. > library(reticulate) > pandas <- import("pandas") > in.file <- pandas$read_csv(file.path(getwd(),"in.csv")) > nrow(in.file) [1] 504 > class(in.file) [1]…
itthrill
  • 1,241
  • 2
  • 17
  • 36
2
votes
1 answer

How to choose the environment in a python chunk in rmarkdown

I try to get familiar with python in R. I made it work using reticulate along the following lines: library(reticulate) py_install("pandas") Then I can always get back to the enviroment where I installed that to…
Richi W
  • 3,534
  • 4
  • 20
  • 39
2
votes
1 answer

Python Reticulate not working in Rstudio Cloud

I am a big fan of Rstudio Cloud and would like to inter-grate R and Python by using the package Reticulate. It looks like Rstudio Cloud is using python 2.7 (no problems with that). When I try to write Python Code in an R markdown document, nothing…
Jordan Wrong
  • 1,205
  • 1
  • 12
  • 32
2
votes
0 answers

call py_config() after loading reticulate library hangs

I am trying to use reticulate from Rstudio to mix python and R calls I have upgraded python to 3.6.5 and R to 3.5.3 library(reticulate) py_config() call to py_config() from the R console rever returns. I have to force quit the R studio process
schuler
  • 175
  • 2
  • 4
  • 12
2
votes
1 answer

R reticulate - recordlinkage package installed in r script but not importing in python script

I've tried py_install("recordlinkage") It returns this error : py_install("recordlinkage") Collecting package metadata: ...working... done Solving environment: ...working... failed PackagesNotFoundError: The following packages are not…
Yeshyyy
  • 669
  • 6
  • 21