We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CategoricalValue
Describe the bug When trying to plot a a categorical CategoricalValue{String, UInt32} (or any CategoricalValue) variable the following error occurs
CategoricalValue{String, UInt32}
ERROR: ArgumentError: cannot compare a `CategoricalValue` to value `v` of type `Float64`: wrap `v` using `CategoricalValue(v, catvalue)` or `CategoricalValue(v, catarray)` first Stacktrace: [1] isless(x::CategoricalValue{String, UInt32}, y::Float64) @ CategoricalArrays ~/.julia/packages/CategoricalArrays/0yLZN/src/value.jl:153 [2] min(x::Float64, y::CategoricalValue{String, UInt32}) @ Base ./operators.jl:490 [3] (::Makie.var"#1100#1106"{Makie.var"#1100#1101#1107"{Symbol}})(plot::TidierPlots.GGPlot) @ TidierPlots ~/.julia/packages/TidierPlots/LtsvY/src/draw.jl:92 [4] draw_ggplot(plot::TidierPlots.GGPlot) @ TidierPlots ~/.julia/packages/TidierPlots/LtsvY/src/draw.jl:226 [5] (::TidierPlots.var"#211#212"{TidierPlots.GGPlot})() @ TidierPlots ~/.julia/packages/TidierPlots/LtsvY/src/show.jl:76 [6] (::Makie.var"#315#316"{@Kwargs{}, TidierPlots.var"#211#212"{TidierPlots.GGPlot}, MakieCore.Attributes})() @ Makie ~/.julia/packages/Makie/8h0bl/src/theming.jl:232 [7] lock(f::Makie.var"#315#316"{@Kwargs{}, TidierPlots.var"#211#212"{TidierPlots.GGPlot}, MakieCore.Attributes}, l::ReentrantLock)
but it will work as a string
To Reproduce
using TidierCats, TidierPlots using Random Random.seed!(10) categories = ["High", "Medium", "Low", "Zilch"]; random_indices = rand(1:length(categories), 57); df = DataFrame( ID = 1:57, CatVar = categorical([categories[i] for i in random_indices], levels = categories)); ggplot(df) + geom_bar(@aes(x = CatVar))
Expected behavior
Ideally it would graph the graph.
Screenshots
df.CatVar = string.(df.CatVar) ggplot(df) + geom_bar(@aes(x = CatVar))
Additional context
Status `~/.julia/environments/v1.10/Project.toml` [337ecbd1] TidierPlots v0.7.8 `https://github.com/TidierOrg/TidierPlots.jl#main
The text was updated successfully, but these errors were encountered:
@rdboyes I took a shot at solving this.. but came up short. I wonder if it's related to the dates issue?
Sorry, something went wrong.
Fixed by #118 !
No branches or pull requests
Describe the bug
When trying to plot a a categorical
CategoricalValue{String, UInt32}
(or any CategoricalValue) variable the following error occursbut it will work as a string
To Reproduce
Expected behavior
Ideally it would graph the graph.
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: