Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

The first code example in the README does not work

Abierto Apto para principiantes
#838 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
r

Línea de trabajo

Comienza localizando el ejemplo introductorio en el README del repositorio y su página correspondiente en future.futureverse.org. Comprueba cómo utiliza el ejemplo slow_fcn y X, y haz que el primer fragmento sea ejecutable, conservando sus comparaciones secuenciales y paralelas. Verifica el ejemplo completo mostrado en una sesión limpia de R, incluidas las secciones de future, futurize, purrr y foreach.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
R
Estrellas
1k
Forks
92
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de futureverse/future

Todos los issues de futureverse/future

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.