Questions tagged [robjects]

Python wrappers for R objects.

8 questions
3
votes
1 answer

Segmentation fault 11 in Python when importing pandas.rpy.common

I'm running Mountain Lion which has Python 2.7.2 installed by default. I've set up a new virtual Python environment using this version of Python. I install a few packages using pip install such as numpy, matplotlib, ipython, and a few others. I've…
user1718097
  • 4,090
  • 11
  • 48
  • 63
2
votes
2 answers

import rpy2.robjects gives "cons memory exhausted"

Until recently I have been using rpy2 to load an R package into a Jupyter notebook running a Python kernel, and use it to read some data from a sqlserver database. A few days ago, I started seeing this error: import rpy2.robjects as ro R[write to…
majr
  • 263
  • 1
  • 6
2
votes
1 answer

Save objects resulting from a for loop in R

I am trying to save different objects resulting from loop. I am using the funcion raster to charge multiple images in different directories,the loop generetes these objects: b : it generates the different directories where I have my images [1]…
francisco corvalan
  • 300
  • 1
  • 4
  • 10
1
vote
1 answer

How to use correlation argument of nlme model in rpy2

I want to estimate the model fit <- nlme::lme(y ~ T + t, random = ~ 1 | sub, correlation = corAR1( form = ~ 1 | sub)) in rpy2. I am running the following without problems: formula = robjects.Formula('y0 ~ T + t + c0') random =…
1
vote
0 answers

Calling r.("quit()") from robjects closes the python process as well

I'm using robjects to execute an R script from python. When R finishes it leaves behind it many temporary files. I can't modify the R script but I also don't see there any reference to tempfile() so I assume it is coming from a library the R script…
user1942586
  • 153
  • 1
  • 3
  • 16
1
vote
0 answers

rpy2 'knn' analysis error: too many ties in knn

I keep getting the same error during knn analysis of a 1-dimensional data set. The function is presented below: def KNN(data,legend): importr('class') #package for knn object print data #both DataFrame objects print legend …
maciek
  • 1,807
  • 2
  • 18
  • 30
0
votes
0 answers

How to open Robj file in Rstudio or R?

I have a Robj file saved to my Desktop that I would like to view. I have downloaded Rstudio to view it. I googled how to view the file and the code file <- dget("/path/to/file.robj") was recommended but all I get is an error that says Error in…
Evan
  • 1,477
  • 1
  • 17
  • 34
0
votes
2 answers

RPy2: LookupError when calling R function 'DEoptim' in python

I've finally got RPy2 working on my Windows 7 computer with Python 2.7.8 and R 3.10.1. I want to call the R function 'DEoptim' which did not come with my R installation however the package has been downloaded via the R Repository and is working in…
pbreach
  • 16,049
  • 27
  • 82
  • 120