revolutionanalytics / iterators Goto Github PK
View Code? Open in Web Editor NEWR iterators package for use with foreach
License: Apache License 2.0
R iterators package for use with foreach
License: Apache License 2.0
This might be a misunderstanding of what the parameter is supposed to do, but I am attempting to use the chunksize parameter when creating an iter object and it is not producing what I would expect the output to be.
Example code:
out = foreach(lTmp = iterators::iter(1:100, chunksize = 15L)) %do% {
print(length(lTmp))
}
I would expect the output to be 15, 15, 15, 15, 15, 15, 10
, but the actual output is 1
repeated 100 times.
If I am misinterpreting, how difficult would it be to add an equivalent parameter to achieve that? I would be happy to fork the repo and put together a pull request if you could point me in the right direction.
Hello, I would like to call to your attention this issue on SO:
https://stackoverflow.com/a/70240075/2203727
Because RStudio gathers metadata for the "Environment" pane, the iterator is consumed by this process and results in faulty execution in the console. The reporter, Mikael Jagan, says that implementing a str
function or refactoring the as.list
function may resolve this issue.
In the meantime, turning on the "Manual Refresh Only" setting works around the issue.
By default, RStudio silently runs str(x)
whenever you assign a value to the name x
in the global environment, in order to populate the Environment pane. As a result,
library("iterators")
x <- iter(1:3)
x$state$i
returns 4L
instead of 0L
. (str.default
evaluates vapply(x, typeof, "")
and vapply
evaluates as.list.iter(x)
.) The issue would be resolved if you wrote your own method for str
avoiding as.list.iter
, or if you moved the functionality of as.list.iter
into a different function altogether so that str.default
uses as.list.default
.
This issue was brought to my attention by a question on Stack Overflow, here.
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.