Skip to content
New issue

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

Using @df with missing values #557

Open
BeastyBlacksmith opened this issue Aug 14, 2024 · 0 comments
Open

Using @df with missing values #557

BeastyBlacksmith opened this issue Aug 14, 2024 · 0 comments

Comments

@BeastyBlacksmith
Copy link
Member

Trying to plot using the @df macro with missing data and I get broken lines.

g75bldn = DataFrame(:Day => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], :Patient => ["Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient A", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient B", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C", "Patient C"], :BaselinedDoseNormalized => [3.382, 4.528, 1.37, 2.639, 0.937, 2.113, 1.741, 3.166, 3.568, missing, missing, 1.587, 2.585, 3.947, 6.331, 6.517, 7.446, 5.062, missing, missing, missing, missing, missing, 7.136, 0.596, 2.577, 23.073, 6.076, 2.361, 0.317, 3.847, 0.658, 3.042, 2.794, missing, missing])


@df g75bldn plot(:Day, :BaselinedDoseNormalized, group=:Patient, lw=1, msw=0, m=:circle, markersize=4, ls=:dash)

I get
skipmissing
ue)

If I try with skipmissing, I get

julia> @df skipmissing(g75bldn) [...]
ERROR: Only tables are supported

which I suppose is because it returns a Base.SkipMissing{DataFrame} type which StatsPlots doesn't like to injest. If I try

julia> @df g75bldn plot([...], skipmissing=true)

nothing changes, same as above, the line is still broken.

I know there are ways with for loops over columns and so on, but it completely defeats the purpose and ease of the @df macro, especially given how easy it automatically handles groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant