df_get_col_logical Function

public function df_get_col_logical(df, index) result(col)

Get logical column by index

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(in) :: df
integer, intent(in) :: index

Return Value logical, dimension(:), allocatable


Source Code

    function df_get_col_logical(df, index) result(col)
        type(data_frame), intent(in) :: df
        integer, intent(in) :: index
        logical, dimension(:), allocatable :: col

        type(column) :: data_col

        if (index < 1 .or. index > df % ncols()) error stop "column index out of range"

        data_col = df % get_data_col(index)
        if (data_col % get_type() /= LOGICAL_NUM) error stop "column is not logical type"

        col = data_col % getl()
    end function df_get_col_logical