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

Issues with data.table #263

Closed
cmhh opened this issue Feb 9, 2017 · 8 comments
Closed

Issues with data.table #263

cmhh opened this issue Feb 9, 2017 · 8 comments

Comments

@cmhh
Copy link

cmhh commented Feb 9, 2017

I've noticed I get errors when using data.table with functions such as hc_add_series. I imagine this is because hc_add_series.data.frame is dispatched, and doesn't work quite right if the data.table package is loaded. A simple fix is to always pass in data.frame(dt), but I wonder if this could be handled explicitly within the package? Perhaps by adding hc_add_series.data.table, for example.

@jbkunst
Copy link
Owner

jbkunst commented Feb 9, 2017

Hi @cmhh

Ooops. Thanks. I will fix this at home ;)!

@jbkunst jbkunst added this to the v0.5.1 milestone Feb 9, 2017
@jbkunst
Copy link
Owner

jbkunst commented Feb 10, 2017

I run:

library(data.table)
library(highcharter)

dt <- data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), v=1:9)
head(dt)


hchart(dt, "scatter", hcaes(x = v, y))

highchart() %>% 
  hc_add_series(dt, "scatter", hcaes(x = v, y))

without problems: http://rpubs.com/jbkunst/highcharter-issue-263

Can we check your sessionInfo?

jbkunst added a commit that referenced this issue Feb 10, 2017
@cmhh
Copy link
Author

cmhh commented Feb 10, 2017 via email

@jbkunst
Copy link
Owner

jbkunst commented Feb 10, 2017

No problem

@jbkunst jbkunst closed this as completed Feb 10, 2017
@jbkunst jbkunst removed the bug label Feb 10, 2017
@jbkunst jbkunst removed this from the v0.5.1 milestone Feb 10, 2017
@cmhh
Copy link
Author

cmhh commented Feb 11, 2017

Not sure what the protocol is regarding commenting on a closed issue...

It turns out it wasn't the highcharter version at all. It seems that this happens when the dtplyr package is loaded:

library(data.table)
library(highcharter)

dt <- data.table(x=rep(c("b","a","c"),each=3), y=c(1,3,6), v=1:9)

hchart(dt, "scatter", hcaes(x = v, y))

library(dtplyr)

hchart(dt, "scatter", hcaes(x = v, y))

After loading dtplyr, I get the following error:

Error in UseMethod("select_") : 
  no applicable method for 'select_' applied to an object of class "NULL"

I guess this is some sort of masking issue related to dtplyr?

Cheers

@jbkunst
Copy link
Owner

jbkunst commented Feb 11, 2017

Don't worry,

I will look into it to see what happens ;).

@jbkunst jbkunst reopened this Feb 11, 2017
jbkunst added a commit that referenced this issue Feb 17, 2017
@jbkunst jbkunst added this to the v0.5.1 milestone Feb 17, 2017
@jbkunst
Copy link
Owner

jbkunst commented Feb 17, 2017

Hi @cmhh

Internally, I forced to be only a data.frame class, and in my test this work well. Please test to check in your enviorment.

Thanks

@jbkunst
Copy link
Owner

jbkunst commented Feb 20, 2017

I'll close the issue. If you still have problem we can reopen.

Regards,

@jbkunst jbkunst closed this as completed Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants