You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey patsy developers, I wonder how can we retrieve the variable names from the model formula string (in R, this can be done via the all.vars function). For example,
if I have ("y ~ x1:x2 + np.log(x3) + I(x4^2)"), I want to return a list of ['x1', 'x2', 'x3', 'x4'].
Similarly, if I have ("~cr(time, df = 3)"), I want to return a list of ['time'].
Your help is highly appreciated!
The text was updated successfully, but these errors were encountered:
I noticed your issue when I was writing up my own. I posted a solution to a different but related problem here; you may be able to use this to solve your problem: #171
It isn't an implementation of all.vars but may none the less still be useful.
Good luck!
Hey patsy developers, I wonder how can we retrieve the variable names from the model formula string (in R, this can be done via the
all.vars
function). For example,if I have ("y ~ x1:x2 + np.log(x3) + I(x4^2)"), I want to return a list of ['x1', 'x2', 'x3', 'x4'].
Similarly, if I have ("~cr(time, df = 3)"), I want to return a list of ['time'].
Your help is highly appreciated!
The text was updated successfully, but these errors were encountered: