diff --git a/src/subdataframe/subdataframe.jl b/src/subdataframe/subdataframe.jl index 5436fc7e0b..75a6481bf2 100644 --- a/src/subdataframe/subdataframe.jl +++ b/src/subdataframe/subdataframe.jl @@ -5,22 +5,20 @@ ## ############################################################################## -include_string(""" - immutable SubDataFrame{T <: AbstractVector{Int}} <: AbstractDataFrame - parent::DataFrame - rows::T # maps from subdf row indexes to parent row indexes - - function SubDataFrame{T}(parent::DataFrame, rows::T) where {T <: AbstractVector{Int}} - if length(rows) > 0 - rmin, rmax = extrema(rows) - if rmin < 1 || rmax > size(parent, 1) - throw(BoundsError()) - end - end - new(parent, rows) +struct SubDataFrame{T <: AbstractVector{Int}} <: AbstractDataFrame + parent::DataFrame + rows::T # maps from subdf row indexes to parent row indexes + + function SubDataFrame{T}(parent::DataFrame, rows::T) where {T <: AbstractVector{Int}} + if length(rows) > 0 + rmin, rmax = extrema(rows) + if rmin < 1 || rmax > size(parent, 1) + throw(BoundsError()) end end - """) + new(parent, rows) + end +end """ A view of row subsets of an AbstractDataFrame