Проблемы с интеграцией R в python
нашел стандартный код запуска R файла через python. Код в r
randomvals <- rnorm(75, 5, 0.5)
par(mfrow = c(1, 2))
hist(randomvals, xlab = 'Some random numbers')
plot(randomvals, xlab = 'Some random numbers', ylab = 'value', pch = 3)
Код в python
# Define command and arguments
command = 'Rscript'
path2script = r"C:/project/max.R"
# Variable number of args in a list
args = ['11', '3', '9', '42']
# Build subprocess command
cmd = [command, path2script] + args
# check_output will run the command and store to result
x = subprocess.check_output(cmd, universal_newlines=True)
print('The maximum of the numbers is:', x)
Выходит ошибка FileNotFoundError: [WinError 2] Не удается найти указанный файл