# Creating custom DataFrame types

**URL:** <https://discourse.julialang.org/t/creating-custom-dataframe-types/4992>\
**Category:** Data\
**Tags:** question, data\
**Created:** [July 21, 2017, 12:26am UTC](https://discourse.julialang.org/t/creating-custom-dataframe-types/4992 "2017-07-21T00:26:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [July 21, 2017, 1:27am UTC](https://discourse.julialang.org/t/creating-custom-dataframe-types/4992/2 "2017-07-21T01:27:16Z")

</div>

Have you tried `struct GeoData <: AbstractDataFrame`? Then all you need to do (assuming there’s a well-defined one) is to implement the basic DataFrame interface your `GeoData` type, and all functions that 1) take an `AbstractDataFrame` and 2) use the interface should automatically work.

This is how we did it in MetaGraphs.

Also: you might reconsider your GeoData struct:

```julia
struct GeoData{T<:AbstractDataFrame} <: AbstractDataFrame
  data::T
  coordnames::Vector{Symbol}
end

```

This avoids having an abstract type as a field, which supposedly improves performance.

---

_[View the full topic](https://discourse.julialang.org/t/creating-custom-dataframe-types/4992)._
