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

Error in callNextMethod() : error in evaluating a 'primitive' next method while doing rbind of data containing nanotime #39

Closed
wsrfad opened this issue Jul 16, 2018 · 17 comments
Labels

Comments

@wsrfad
Copy link

wsrfad commented Jul 16, 2018

Error in callNextMethod() : error in evaluating a 'primitive' next method: Error in as.integer64(value) :argument "value" is missing, with no default
Calls: [<- -> [<-.integer64 -> as.integer64 [<- -> new -> initialize -> initialize -> callNextMethod

Why could I be facing this issue ?

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

Note : I am facing this issue on 1 machine & not on another machine. I have both machines at master version of nanotime; what could be the issue ?

@eddelbuettel
Copy link
Owner

Nobody can tell you unless you

  • learn how to prepare a reproducible bug report
  • stating versions used, OS used, ...

See maybe https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example or other tutorials.

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

I was already on my way to debug the code..But there may be a hunch produced by the developers of the code on when you see these kind of messages, or rather what kind of code paths suffer this. To have a reproducible bug, I will have to dig deeper into implementation of nanotime / callNextMethod, which I am already doing. Last, I raised an issue with deep analysis. But you always do not have time, a bit of idea may help you drill the exact issue faster. Anyways ..

@eddelbuettel
Copy link
Owner

It is a CRAN package. These have tests. And they are tested. See here: https://cloud.r-project.org/web/checks/check_results_nanotime.html

So unless you prove something reproducible it most likely is "merely" an out of sync installation on your box.

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

Initial, yet useful info. Will get back with more. Meanwhile, if you have some info, so share

The machine where it repros (R version 3.2.3), using the same code below, installs the dependencies 'bit', 'Rcpp', 'bit64', 'RcppCCTZ', 'zoo', while it does not do with the machine where it repros (R version 3.4.4).

Other messages, while installation

Creating a generic function for 'print' from package 'base' in package 'nanotime'

Error

error in evaluating a 'primitive' next method: Error: incompatible types (from symbol to double) in subassignment type fix"
Calls: rbind ... [<- -> new -> initialize -> initialize -> callNextMethod

Code

system("mkdir -p ~/R/library")
.libPaths( c( .libPaths(), "~/R/library") )
repo = "http://cran.us.r-project.org"
mylib = "~/R/library"
install.packages("nanotime", lib = mylib, repos = repo)
library("nanotime", lib.loc = .libPaths())
d = NULL
td = data.frame("time" = c("1", "2", "3"), "col" = c(1, 2, 3), stringsAsFactors = FALSE)
td$time = nanotime(as.integer64(td$time))
tmp = rbind(d, td)

@eddelbuettel
Copy link
Owner

eddelbuettel commented Jul 16, 2018

The message is a just, a message. It is not an error.

Now your error code appears to be

d = NULL
td = data.frame("time" = c("1", "2", "3"), "col" = c(1, 2, 3), stringsAsFactors = FALSE)
td$time = nanotime(as.integer64(td$time))
tmp = rbind(d, td)

which works for me:

R> d <- NULL
R> td <- data.frame(t=nanotime(c(1, 2, 3)), col= 1:3, stringsAsFactors = FALSE)
R> td
                                    t col
1 1970-01-01T00:00:00.000000001+00:00   1
2 1970-01-01T00:00:00.000000002+00:00   2
3 1970-01-01T00:00:00.000000003+00:00   3
R> rbind(d,td)
                                    t col
1 1970-01-01T00:00:00.000000001+00:00   1
2 1970-01-01T00:00:00.000000002+00:00   2
3 1970-01-01T00:00:00.000000003+00:00   3
R> 

In general, I recommend sticking with data.table over data.frame.

Next time, please start from a reproducible error message.

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

I even used github version in both. That reproed in machine. I do not appreciate your lack of patience & ignorance in closing this issue. Anyways, i will get to the root of it !

While you say about rbind starting with NULL, it works with all other data ! Also, rbind example is a simplistic one. It may repro with other scenarios also.. ( i have done my homework)

@eddelbuettel
Copy link
Owner

Hm. I also tried on a box where I am pretty sure it is the CRAN version that is installed, and it too worked.

@eddelbuettel
Copy link
Owner

Maybe you are not using the current CRAN version. I can't tell -- your report has insufficient detail.

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

Now, try a repro:

Use R version 3.2.3
Install nanotime
Rerun the same code..

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

d = NULL
td = data.frame("time" = c("1", "2", "3"), "col" = c(1, 2, 3), stringsAsFactors = FALSE)
#td$time = nanotime(as.integer64(td$time))
d = rbind(d, td)

If I comment your 'tested' nanotime, this does not give any error.

Now, this does repro ! I stand vindicated...

@wsrfad
Copy link
Author

wsrfad commented Jul 16, 2018

I know of one more nanotime issue even in release, but whatever happened is very disappointing. I chose not to raise it

@eddelbuettel
Copy link
Owner

Use R version 3.2.3

I do this as a volunteer, and I do not have time to support three year old R versions. That is your problem. Try R 3.4.4 or R 3.5.1, things should work. Good luck.

@eddelbuettel
Copy link
Owner

Your whole problem is, if I may guess, that you seem to insist on passing your integer64 arguments as characters, even though are numbers. But whatever.

@eddelbuettel
Copy link
Owner

One last point: You don't have a name. You hide behind a pseudonym. You have no repos.

We do this as a gift economy. Most people who expect something for free (and of course also "immediately") at least try to give something back. What have you done for us? I grant you that your last bug report (which you then ignored for two weeks) was moderately helpful. This exchange here however was a complete waste of time, yours and mine.

@wsrfad
Copy link
Author

wsrfad commented Jul 17, 2018

Thanks sir for maintaining. I respect that. But your tone could have been better / more encouraging for handling this issue. You could have said we do not support this version, or tell some workaround. Even do.call(rbind, lapply generated list) does not work.

As regards '''passing your integer64 arguments as character''' is concerned, I did that as I was actually reading nanos time from a file, to read them with precision, I have to read them as character. So, I just used that code snippet. There is no perfect wise man in this world. We must respect each other and help each other become better. That would be real giving !

@eddelbuettel
Copy link
Owner

You could take a look at the existing documentation and try, say, look at the README.md and just vary that:

R> library(nanotime)
R> x <- nanotime("2018-01-02T03:04:05.006007008+00:00")
R> x
[1] "2018-01-02T03:04:05.006007008+00:00"
R> 

There is even help(nanotime). But why read when you can just try random crap and then waste my justifying it.

Repository owner locked and limited conversation to collaborators Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants