First time using the RPy2 implementation in Python. Attempting to do an one-way ANOVA with two factors. It works in R on another machine, but Python does not like the syntax. Any thoughts are appreciated!
from rpy2.robjects import aov
huanova = aov(formula = df1['human_den'] ~ df1['region']+df1['years'])
Error message points at the tilda.
huanova = aov(formula=df1['human_den'] ~ df1['region']+df1['years'])
^
SyntaxError: invalid syntax