code: def data_py(o, *args, **kwargs):
      
      if isinstance(o, basestring):
          fname = o
      else:
          if not is_pandas_df(o):
              # convert incoming data layout to pandas' DataFrame
              o = pandas.DataFrame(o)
          fname = tempfile.NamedTemporaryFile().name
          o.to_csv(fname, sep=',', encoding='utf-8', index=False)
      kwargs["sep"] = esc(',')
      read_csv_stmt = GGStatement("read.csv", esc(fname), *args, **kwargs).r
      return GGData("data = {}".format(read_csv_stmt), fname=fname)
docs: converts python object into R Dataframe definition
  
      converts following data structures:
  
        row oriented list of dictionaries:
  
            [ { 'x': 0, 'y': 1, ...}, ... ]
  
        col oriented dictionary of lists
  
            { 'x': [0,1,2...], 'y': [...], ... }
  
      @param o python object to convert
      @param args argument list to pass to read.csv
      @param kwargs keyword args to pass to read.csv
      @return a tuple of the file containing the data and an
          expression to define data.frame object and set it to variable "data"
  
      data = read.csv(tmpfile, *args, **kwargs)