I am trying to utilize the R package pmultinom in Python by using pyRserve, with numbers that are imported to the code. I am having the following error:
REvalError: Error: object 'pmultinom' not found.
import pyRserve
num1 = 1
num2 = 2
num3 = 3
num4 = 4
num5 = 5
num6 = 6
vec1 = (.2,.3,.5)
r_script = '''
install.packages(pmultinom)
library(pmultinom)
pmultinom(
'''
full_rscript =( r_script + 'lower=c(' + str(num1) + ',' + str(num2) + ',' + str(num3) +
'), upper=c(' + str(num4) + ',' + str(num5) + ',' +
str(num6) +
'), size=' + str(num7) + ', probs=' + str(vec1) + ')'
)
output = conn.eval(full_rscript)
When I try a similar code with
conn.r.pmultinom(…)
I get an error that the function can't be found.