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

Cannot View data frame with integer64 columns #3145

Closed
renkun-ken opened this issue Jul 12, 2018 · 7 comments
Closed

Cannot View data frame with integer64 columns #3145

renkun-ken opened this issue Jul 12, 2018 · 7 comments

Comments

@renkun-ken
Copy link

@renkun-ken renkun-ken commented Jul 12, 2018

System details

RStudio Edition : both Desktop and Server
RStudio Version : 1.2.812
OS Version      : Ubuntu 16.04, macOS 10.13.6
R Version       : 3.4.4, 3.5.1

Steps to reproduce the problem

data <- data.frame(x = bit64::as.integer64(c(1,2,3)))
View(data)
Error in hist.default(hist_vals, plot = FALSE) : 
  some 'x' not counted; maybe 'breaks' do not span range of 'x'
In addition: Warning message:
In pretty.default(range(x), n = breaks, min.n = 1) :
  Internal(pretty()): very small range.. corrected
@ronblum
Copy link
Contributor

@ronblum ronblum commented Jul 12, 2018

Thanks @renkun-ken for letting us know about this issue.

Reproduced on Windows 10 and MacOS 10.12.6 (Sierra). This is a regression (worked in RStudio 1.1.453).

@ronblum
Copy link
Contributor

@ronblum ronblum commented Jul 16, 2018

This is working (as of 1.2.830) when initially rendered. However:

  1. Open a project
  2. Repeat the steps above
    • Works well
  3. Close the project
  4. Reopen the project
    • The error returns, along with an empty data viewer

@ronblum ronblum reopened this Jul 16, 2018
@jmcphers
Copy link
Member

@jmcphers jmcphers commented Jul 19, 2018

The error's actually changed somewhat; it now references the new code:

Error in hist.default(as.numeric(hist_vals), plot = FALSE) :

The problem is that as.numeric doesn't work on integer64 values until the bit64 package is loaded. That's why it doesn't work on startup, but it does during the session in which you've called bit64::as.integer64 (as doing so loads the package).

We try pretty hard not to have RStudio load spurious packages at startup, and I'm also not sure all of the codepaths that support the histogram are going to handle 64 bit integers gracefully, so I think we should prevent this kind of thing by refusing to histogram-ize any numeric columns which have a special class applied.

@ronblum
Copy link
Contributor

@ronblum ronblum commented Aug 21, 2018

The error is gone. However, we're still displaying values in both cases. First we get (1, 2, 3):
123
but when the project is reopened, we get this:
int64

@ronblum ronblum reopened this Aug 21, 2018
@jmcphers
Copy link
Member

@jmcphers jmcphers commented Sep 4, 2018

The bit64 package must be loaded in order for us to get sensible values. We do not load packages on startup, so the raw values are displayed. This behavior is weird, but it isn't a regression, and should be filed separately.

@ronblum
Copy link
Contributor

@ronblum ronblum commented Sep 5, 2018

Done! Verified that error is gone.

@nielsenrechia
Copy link

@nielsenrechia nielsenrechia commented Sep 22, 2020

Hi, I'm getting the same error Error in hist(hist_vals, plot = FALSE) : could not find function "hist", but insted of integer64 it is occuring for for double columns.

data <- data.frame(x = as.double(c(1,2,3)))
View(data)

Someone could help me?

thanks

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

4 participants