GithubHelp home page GithubHelp logo

Error in callNextMethod() : error in evaluating a 'primitive' next method while doing rbind of data containing nanotime about nanotime HOT 17 CLOSED

eddelbuettel avatar eddelbuettel commented on May 23, 2024
Error in callNextMethod() : error in evaluating a 'primitive' next method while doing rbind of data containing nanotime

from nanotime.

Comments (17)

wsrfad avatar wsrfad commented on May 23, 2024

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 ?

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

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 ..

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

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)

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

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)

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

Now, try a repro:

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

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

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...

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

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

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

wsrfad avatar wsrfad commented on May 23, 2024

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 !

from nanotime.

eddelbuettel avatar eddelbuettel commented on May 23, 2024

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.

from nanotime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.