Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The first code example in the README does not work

オープン 初心者向け
#838 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
r
領域
documentation

調査の方向性

まず、リポジトリのREADMEにある導入例と、future.futureverse.org上の対応するページを見つけます。例で slow_fcn と X がどのように使われているかを確認し、逐次実行と並列実行の比較を維持したまま、最初のスニペットを実行可能にします。future、futurize、purrr、foreach の各セクションを含め、表示されている例全体をクリーンな R セッションで検証します。

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug

The future package's README in the GitHub repository and on https://future.futureverse.org/ contains an introductory code example that does not work.

The example does not work and results in an error because it calls a function named slow_fcn and a variable named X that do not exist.

I am new to the future package and am trying to learn about the it without any prior knowledge. I would like to share my perspective and experience that the first example presented not working is a hurdle to trying to learn about the package, as it prevents me from trying out the example and learning about what it is trying to demonstrate. I initially wondered if I had all of the required packages and package versions installed or if there was something implicit not included in the code example that I was supposed to know to set up first.

Here is the first code snippet on the README:

library(future)
plan(multisession)

## Sequential evaluation of an R expression
y <- slow_fcn(X[1])

## Parallel evaluation of an R expression
f <- future(slow_fcn(X[1]))
y <- value(f)


library(futurize)

## Sequential and parallel base R apply
y <- lapply(X, slow_fcn)
y <- lapply(X, slow_fcn) |> futurize()

## Sequential and parallel purrr map
library(purrr)
y <- X |>  map(slow_fcn)
y <- X |>  map(slow_fcn) |> futurize()

## Sequential and parallel foreach calls
library(foreach)
y <- foreach(x = X) %do% slow_fcn(x)
y <- foreach(x = X) %do% slow_fcn(x) |> futurize()

And here is the resulting error when it is run:

Image

Expected behavior

I think the first code example presented to newcomers would serve as a better introduction and learning resource if the code worked and demonstrated/explained the usage of the future package compared to the sequential equivalents that it includes.

主要言語
R
スター
1k
フォーク
92
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

futureverse/future のほかの issue

futureverse/future の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。