Skip to content

BUG: Error in kernelboot( ... : object '.Random.seed' not found #6

Closed

Description

@HenrikBengtsson

Hi, your kernelboot::kernelboot() assumes that .Random.seed exists (see below) but that is not always guaranteed to be the case.

> kernelboot::kernelboot
function (data, statistic, R = 500L, bw = "default", kernel = c("multivariate", 
    "gaussian", "epanechnikov", "rectangular", "triangular", 
    "biweight", "cosine", "optcosine", "none"), weights = NULL, 
    adjust = 1, shrinked = TRUE, ignore = NULL, parallel = FALSE, 
    workers = availableCores()) 
{
    call <- match.call()
    kernel <- match.arg(kernel)
    seed <- .Random.seed   <======== HERE
    n <- NROW(data)
    m <- NCOL(data)
    vars <- NULL

I think the simplest solution is to use:

    seed <- get0(".Random.seed", envir = .GlobalEnv, ifnotfound = NULL)

The reason why you haven't run into problems with this yet is when loading future (<= 1.14.0) together with your package, a side-effect was that .Random.seed was (incorrectly) created. I've now cleaned this up, which means that with future (> 1.14.0) .Random.seed may not be set. When running reverse package dependency checks, R CMD check kernelboot_0.1.5.tar.gz now produces:

* checking tests ...
  Running ‘test_parallel.R’
 ERROR
Running the tests in 'tests/test_parallel.R' failed.
Last 13 lines of output:
  +   set.seed(0xBEEF)
  +   s1 <- kernelboot(mtcars, function(data) coef(lm(mpg ~ disp + hp + drat, data = data)),
  +                    R = 10, parallel = TRUE)
  + 
  +   set.seed(0xBEEF)
  +   s2 <- kernelboot(mtcars, function(data) coef(lm(mpg ~ disp + hp + drat, data = data)),
  +                    R = 10, parallel = TRUE)
  + 
  +   stopifnot( all.equal(s1, s2) )
  + 
  + }
  Error in kernelboot(mtcars, function(data) coef(lm(mpg ~ disp + hp + drat,  : 
    object '.Random.seed' not found
  Calls: stopifnot -> kernelboot
  Execution halted

Activity

  1. twolodzko commented on Oct 30, 2019

    @twolodzko
    Owner

    Thanks for the report and suggesting the solution.

  2. HenrikBengtsson commented on Nov 6, 2019

    @HenrikBengtsson
    Author

    Thanks. I've verified that kernelboot (master branch) works with the upcoming future 1.15.0, which I'd like to submit to CRAN rather soon. Would you mind submitting your kernelboot 0.1.6 to CRAN as soon as you have time?

  3. twolodzko commented on Nov 6, 2019

    @twolodzko
    Owner

    @HenrikBengtsson I submitted it a week ago but they still didn't upload it...

  4. HenrikBengtsson commented on Nov 6, 2019

    @HenrikBengtsson
    Author

    Your package is sitting in ftp://cran.r-project.org/incoming/waiting/, which means CRAN is waiting for a response from you. Could be a hickup while running your tests triggering a false NOTE, WARNING, or ERROR. Check you emails / spam folder - what was the latest email notification you've got from them on Oct 31/Nov 1?

  5. HenrikBengtsson commented on Nov 6, 2019

    @HenrikBengtsson
    Author

    Correction: CRAN is waiting for a response from you

  6. twolodzko commented on Nov 6, 2019

    @twolodzko
    Owner

    @HenrikBengtsson I wrote them two times. Unfortunately there is some strange warning in their autochecks, that does not seem to be related to my package. There doesn't seem much that I can do about it. Again, thanks for noticing me about the bug.

  7. HenrikBengtsson commented on Nov 6, 2019

    @HenrikBengtsson
    Author

    I see; I guess they just have a big backlog. Hopefully, this hurdle is just a one-time hiccup and it'll be smoother next time. Thxs.

  8. HenrikBengtsson commented on Nov 7, 2019

    @HenrikBengtsson
    Author

    I see kernelboot 0.1.6 is on CRAN now. Thxs again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions