How to multiply scalar by ListVector in rpy2
<p>I'm running the following analysis and trying to plot the inverse logit of my model:</p>

<pre><code>R.plot(formula, data=data, ylab = 'P(outcome =  1 | outcome)', xlab = 'SURVRATE: Probability of Survival after 5 Years', xaxp = c(0, 95, 19))
a = R.coef(mod1)[0] 
b = R.coef(mod1)[1]
R.curve(invlogit(a + b*R.x)) 
</code></pre>

<p><code>invlogit</code> is an R function that I am accessing via STAP.</p>

<p>Everything works great, but when I run the <code>curve</code> function, I get an error that <code>TypeError: unsupported operand type(s) for *: 'float' and 'ListVector'</code>...</p>

<p>I've tried various ways of handling this, like using <code>np.multiply</code> among others, all to no avail. How do I handle multiplication of a scalar by a ListVector within python?</p>

<p>Kludgey solution is to just use the <code>rmagic</code> commands. It appears to be the path of least resistance to convert all my R code to the rpy2 equivalent.</p>

python rpy2 scalar vector-multiplication