# \`select not defined\` error whilst trying to plot a results DataFrame

**URL:** <https://discourse.julialang.org/t/select-not-defined-error-whilst-trying-to-plot-a-results-dataframe/38836>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 5, 2020, 9:36pm UTC](https://discourse.julialang.org/t/select-not-defined-error-whilst-trying-to-plot-a-results-dataframe/38836 "2020-05-05T21:36:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HarrisonWilde](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@HarrisonWilde](https://discourse.julialang.org/u/HarrisonWilde)\
**Post date:** [May 5, 2020, 9:36pm UTC](https://discourse.julialang.org/t/select-not-defined-error-whilst-trying-to-plot-a-results-dataframe/38836/1 "2020-05-05T21:36:27Z")

</div>

Hi, I wrote some code to plot the results of some experiments the other day, and it worked fine, then I must have changed something because I am now getting a rather strange error:

```julia
ERROR: UndefVarError: select not defined
Stacktrace:
 [1] extract_columns_and_names(::DataFrame, ::Symbol, ::Vararg{Any,N} where N) at /Users/harrisonwilde/.julia/packages/StatsPlots/Y1rGZ/src/df.jl:159
 [2] (::var"#72#75"{Float64,Array{String,2},Array{String,1}})(::DataFrame) at ./none:0
 [3] plot_real_α(::DataFrame, ::Float64, ::Array{String,2}, ::Array{String,1}, ::String) at /Users/harrisonwilde/Library/Mobile Documents/com~apple~CloudDocs/PhD/Synthetic Data/src/creditcard/plotting.jl:35
 [4] top-level scope at none:0

```

This is after running this:

```julia
function plot_real_α(df, α, divergences, metric, t)

    mkpath("src/creditcard/plots/$(t)/")
    fdf = filter(row -> row[:real_α] == α, df)
    print(fdf)
    p = @df fdf plot(
        :synth_α,
        cols(Symbol("$(div)_$(metric)") for div in divergences),
        title = "$(metric) divergence comparison, real alpha = $(α)",
        label = [div for div in divergences],
        xlabel = "Synthetic Alpha",
        ylabel = metric,
        legendtitle = "Divergence",
    )
    p = plot!(size=(1000, 700), legend=:outertopright)
    png(p, "src/creditcard/plots/$(t)/real_alpha_$(α)__$(metric)")

end

plot_real_α(results, 0.1, ["beta" "weighted" "naive" "no_synth"], ["auc", "ll"], t)

```

Running `select(df, :col)` works fine so I am not sure what the issue is here.

Thanks!
