Example in introduction page doesn't work - NameError: name 'data' is not defined

Issue #213 resolved
Alistair Miles created an issue

From page at http://rpy.sourceforge.net/rpy2/doc-2.4/html/introduction.html I tried to run this code snippet:

import math, datetime
import rpy2.robjects.lib.ggplot2 as ggplot2
import rpy2.robjects as ro
from rpy2.robjects.packages import importr
base = importr('base')

mtcars = data(datasets).fetch('mtcars')['mtcars']

...and get this error:

NameError                                 Traceback (most recent call last)
<ipython-input-20-155f9a4ea5e8> in <module>()
      5 base = importr('base')
----> 7 mtcars = data(datasets).fetch('mtcars')['mtcars']

NameError: name 'data' is not defined

Comments (3)

  1. Log in to comment