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

Plot DataFrame with NA #538

Closed
juliohm opened this issue Feb 1, 2015 · 5 comments
Closed

Plot DataFrame with NA #538

juliohm opened this issue Feb 1, 2015 · 5 comments

Comments

@juliohm
Copy link

juliohm commented Feb 1, 2015

Suppose I have a DataFrame with missing rows. How do I drop all NAs in the spot? I see a function dropna() but I'm wondering if Gadfly has a cleaner solution.

plot(df, x="foo", y="bar", removeNA)?

I'm getting an error:

convert has no method matching convert(::Type{Float64}, ::DataArrays.NAtype)

@juliohm
Copy link
Author

juliohm commented Nov 3, 2015

Having a DataFrame with missing rows seems conceptually incorrect from the start. I'm closing the issue.

@juliohm juliohm closed this as completed Nov 3, 2015
@vchuravy
Copy link

vchuravy commented Nov 3, 2015

For plotting I solve that with defining locally

Base.convert(::Type{Float64}, ::DataArrays.NAtype) = NaN

, but you wouldn't want such a definition globally.

@gestay
Copy link

gestay commented Apr 1, 2016

Why is this issue closed? The @vchuravy solution works, but I think Gadfly should handle this.

@juliohm
Copy link
Author

juliohm commented Apr 1, 2016

@gestay I closed the issue because having a DataFrame with missing rows is kind of buggy. Whatever application you have, a missing row doesn`t make much sense, agree? If you have a good counter example, please share. 😊

@vchuravy
Copy link

vchuravy commented Apr 2, 2016

For Gadfly itself, one of the problems I encountered is how to plot data series with gaps, and make these gaps visible.
Let's say I have two continuous observations, but due to experimental constraints, I am not guaranteed at time t to have both of the observations and I also could have one or none.

If I only have one, I would assign the NA value to the other observation. In that sense it is natural to have NA values in rows and columns of data. The question is if there is a natural way for gadfly to plot NA values.

Another situation are functions with discontinuousness.

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

3 participants