The first code example in the README does not work
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
- Área
- documentation
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
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:
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
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de futureverse/future
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
futureverse/future#837 ·
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
futureverse/future#836 · 2 comentarios ·
-
Entire global environment getting passed along with user-defined (global) functions in shinyAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
futureverse/future#833 ·
-
feature/resources RNG
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
futureverse/future#832 ·
-
RNG
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
futureverse/future#831 · 1 comentario ·
Todos los issues de futureverse/future
Issues similares
-
Elevation orderAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
inbo/erl-butterflies-2025#19 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
The-Strategy-Unit/nhp_output_reports#116 · 1 comentario ·
-
Clearing results in the order they were sent leaves one registered, breaking `dbDisconnect()`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#322 ·