renozao / rngtools Goto Github PK
View Code? Open in Web Editor NEWR package - Utility functions for working with Random Number Generators
License: GNU General Public License v3.0
R package - Utility functions for working with Random Number Generators
License: GNU General Public License v3.0
This needed for R >= 3.6 and would be around the functions setRNG
, .setRNG
, RNGseq_seed
I couldn't find this in the documentation, but there are two behaviours I noticed with RNGseq()
;
RNGseq()
depends upon the kind of RNG currently in use (i.e. the value returned by RNGkind()
), and;RNGseq()
will silently set the kind of RNG in use, but seems to not do this in subsequent calls.So; in a new R session, calling RNGseq()
twice with the same data produces different results, and switches the kind of RNG to L'Ecuyer:
RNGkind()
# [1] "Mersenne-Twister" "Inversion" "Rejection"
rngtools::RNGseq(2, seed=200)
# [[1]]
# [1] 10407 1701029135 -449056764 -1942788299 1218205298 1812398923
# [7] -535596528
#
# [[2]]
# [1] 10407 1406170078 1440095458 1901155434 897317021 -103132196 1458019338
RNGkind()
# [1] "L'Ecuyer-CMRG" "Inversion" "Rejection"
rngtools::RNGseq(2, seed=200)
# [[1]]
# [1] 10407 1575099567 -969614556 1117278165 1608171154 -1670773525
# [7] -1475289296
#
# [[2]]
# [1] 10407 307409289 537008121 -2103044188 1354762305 1946813003
# [7] -1982029087
Now if I ask R to switch back to Mersenne (for whatever reason, just to understand behaviour of RNGseq()
), two more calls to RNGseq()
will now:
RNGkind("Mersenne")
RNGkind()
# [1] "Mersenne-Twister" "Inversion" "Rejection"
rngtools::RNGseq(2, seed=200)
# [[1]]
# [1] 10407 1701029135 -449056764 -1942788299 1218205298 1812398923
# [7] -535596528
#
# [[2]]
# [1] 10407 1406170078 1440095458 1901155434 897317021 -103132196 1458019338
rngtools::RNGseq(2, seed=200)
# [[1]]
# [1] 10407 1701029135 -449056764 -1942788299 1218205298 1812398923
# [7] -535596528
#
# [[2]]
# [1] 10407 1406170078 1440095458 1901155434 897317021 -103132196 1458019338
RNGkind()
# [1] "Mersenne-Twister" "Inversion" "Rejection"
Is this intended behaviour, if so, could it be documented?
Here's some the version info for the output above
packageVersion('rngtools')
# [1] ‘1.5’
version
# _
# platform x86_64-pc-linux-gnu
# arch x86_64
# os linux-gnu
# system x86_64, linux-gnu
# status
# major 3
# minor 6.3
# year 2020
# month 02
# day 29
# svn rev 77875
# language R
# version.string R version 3.6.3 (2020-02-29)
# nickname Holding the Windsock
Hi,
please consider adding a NEWS file to the package to make it easier for end-users/developers to see what has been updated.
I'm seeing
checking R code for possible problems ... NOTE
RNGseq : <anonymous>: no visible global function definition for
‘nextRNGStream’
RNGseq: no visible global function definition for ‘nextRNGStream’
RNGseq_seed: no visible global function definition for ‘nextRNGStream’
checkRNG: no visible global function definition for ‘checkTrue’
Hello,
I received an email this morning that due to some issues with rngtools, they are planning on archiving the package which will cause issues for several other packages that have strong reverse dependency on it.
The issues associated with rngtools are at:
https://cran.r-project.org/web/checks/check_results_rngtools.html
Any chance you can fix those issues so that it passes tests on CRAN.
Any help greatly appreciated!
Just in case you're not aware, in DESCRIPTION you link to https://renozao.github.io/rngtools/. But that website refers to rngtools 1.2.4, which is from 2018-05-10. Looks like you need to refresh that website, or maybe drop the link in DESCRIPTION?
In your DESCRIPTION file, you list the license as GPL-3, while in the header for file R/RNG.R
the license text states
...
you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
suggesting that the code is covered under GPL-2.
Could you please clarify which license your software is formally covered under? Adding a specific LICENSE file to your repo would also help in this matter.
The GH repo has
whereas CRAN has it as
Since there are also different versions of the package (1.3.1 on GH and 1.3.1.1 on CRAN), I'm guessing that a CRAN maintainer revised your package and bumped the version. I see no public mention of the reason.
Can you submit a new version that lowers the version requirement? This affects NMF
and now that package's dependencies only work for R-devel.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.