All Questions
5,961
questions
0
votes
0
answers
33
views
Getting "'4.4*' for 'r-base' was not found" error while installing R 4.4.1 version using bookworm image as base
# Start with a base Debian image
FROM python:3.13-rc-bookworm
ARG R_VERSION=4.4.1
# Set environment variables
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
# Install system dependencies
...
0
votes
0
answers
53
views
Positron IDE can't find the Python path
I just installed Positron IDE based on Visual Studio Code, I can work with R programming language and Python, but it doesn't run python code, R is set up as global, Python is set up as global but ...
0
votes
0
answers
18
views
I am trying to convert a MDI file into PDF executing the code the output is success full conversion. In my output folder I can't see my converted pdf [closed]
I'm looking for a way to convert MDI (Microsoft Document Imaging) files to PDF format programmatically. I cannot use ImageMagick due to installation restrictions, and Microsoft Office Document Imaging ...
0
votes
0
answers
39
views
Reticulate py_config() returns error, python310.dll - The specified module could not be found
Here's the code I'm running.
library("reticulate")
virtualenv_create("r-reticulate")
use_virtualenv("r-reticulate", required = TRUE)
Sys.setenv(RETICULATE_PYTHON = "...
0
votes
0
answers
34
views
Loading R libraries in Jupyter notebook using Rpy2 and R Magic results in error
I am trying to load several R packages like such:
%%R
# Load libraries from correct lib Paths for my environment - ignore this!
.libPaths(.libPaths()[c(3,2,1)])
# Load all the R libraries we will ...
2
votes
0
answers
27
views
Neural Network In R (Response not generating)
I am running the code below for Neural Network in R. I have already installed TensorFlow which is working fine. I am facing Error in py_call_impl(callable, call_args$unnamed, call_args$named) : ...
1
vote
0
answers
21
views
Run mgcv package in python via rpy2
I am trying to create a python package to run mgcv in R, to replace the functionality of pyGAM. I want to start with the r command gam(), and need to use rpy2 to transfer data from R. I don't know how ...
0
votes
1
answer
38
views
Python script in R Markdown
I am using R Markdown and running a python script in it using reticulate. When I am trying to print out some values related to the model then upon knitting the output shows like this:
Even though I ...
2
votes
2
answers
81
views
How to make a `functools.reduce` implementation that looks similarly as `Reduce` in R?
Here is an R example of using Reduce
x <- c(1, 2, 2, 4, 10, 5, 5, 7)
Reduce(\(a, b) if (tail(a, 1) != b) c(a, b) else a, x) # equivalent to `rle(x)$values`
The code above is to sort out the ...
1
vote
1
answer
70
views
Define a matrix in R in a similar fashon as with Numpy
I love the fact that using numpy in Python it is very easy to define a matrix/array in a way that is very close to the mathematical definition.
Does R have a similar way of achieving this result?
...
1
vote
0
answers
77
views
Why are R and Python giving me different confidence intervals in a logistic model?
I'm making a logistic model predicting whether individuals' health (0=good, 1=poor) is affected by whether they're exposed to secondhand smoke and a few other demographic factors. In R, the code I run ...
0
votes
2
answers
69
views
How to make statsmodels' ANOVA result match R's ANOVA result
The following question is sort of a concrete adaptation of a post on StatsExchange.
The following R script runs just fine:
library(reshape)
J1 <- c(9,6,8,7,10,6)
J2 <- c(2,1,4,1,5,2)
J3 <- c(...
2
votes
0
answers
34
views
Python processes being leaked when using Reticulate and joblib
I'm having a issue when using joblib.Parallel through reticulate. Basically, if I have an R script call a python function that uses joblib.Parallel to parallelize running of code, and then run that R ...
1
vote
2
answers
105
views
Modulus `%%` giving unexpected result for `3.1 %% 0.1`. Is this expected?
I'm using the base modulus (%%) operator, and just struggling to understand the following behaviour. My understanding is that %% returns the remainder after dividing 2 numbers. So eg:
5 %% 2
# [1] 1
...
3
votes
1
answer
92
views
Reading csv data is faster in R with fread() than in Pandas with read_csv() [closed]
I have large datasets- 100 million rows, 100+ columns.
When I read them in R using fread, it gets done quite fast (25 to 30 mins). Same thing takes almost an hour in Python. I had read previously that ...