Giter VIP home page Giter VIP logo

iterators's People

Contributors

beccadaniel avatar hongooi73 avatar richcalaway avatar steveweston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

iterators's Issues

chunksize parameter in iters function not producing actual chunks

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.

Incompatibility with RStudio when "Refresh Automatically" is turned on

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.

Mutation of `"iter"` objects bound in global environment in RStudio

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.

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.