Gadfly and flatten not defined

using JuliaDB, JuliaDBMeta, DataFrames, Gadfly
import Cairo
import Fontconfig
using Compose

group_data = JuliaDB.load("group_data")

test_plot = Gadfly.plot(
        group_data |> DataFrame,
        x = "Group",
        y = "Differences",
        Guide.xlabel("Group"),
        Guide.ylabel("Value"),
        Guide.yticks(ticks = collect(range(-1, 1, step = .2))),
        Scale.x_discrete(levels = groups),
        boxplot_theme,
        Geom.boxplot
    );

However after running this script I keep getting the following error: WARNING: both DataFrames and Iterators export "flatten"; uses of it in module Gadfly must be qualified. How do I surpress Iterators.flatten for DataFrames.flatten within the Gadfly plot function.

Thanks for any help!

The problem is that the most recent version of DataFrames exports the function “flatten”.
This conflicts with an identical function name in Gadfly.
So do this:
]add DataFrames@0.19

That will downgrade DataFrames to version 0.19.4 which does not export flatten.

PR https://github.com/GiovineItalia/Gadfly.jl/pull/1360 will make Gadfly compatible with DataFrames 0.2

1 Like

Thank you both. I was able to downgrade DataFrames for it to work. I’ll look at your suggestion Mattriks later night.

the flatten for DataFrames and JuliaDB should really be in DataAPI.jl. I made an issue here.