Remove the situation column from `summary` when all_situations=FALSE
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by locating the summary implementation and checking how all_situations=FALSE shapes its output. Compare the current and proposed outputs, including the suggestion about removing group, and check existing tests for summary behavior. Done means the returned data frame omits the requested redundant columns without changing the remaining statistics.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When using all_situations=FALSE (the default) in summary, we still get the "situation" column, which is just polluting the output data.frame because all values are set to "all_situations" anyway.
Example:
library(CroPlotR)
workspace <- system.file(
file.path("extdata", "stics_example_1"),
package = "CroPlotR"
)
sim <- SticsRFiles::get_sim(
workspace = workspace,
usms_file = file.path(workspace, "usms.xml")
)
obs <- SticsRFiles::get_obs(
workspace = workspace,
usm = situations,
usms_file = file.path(workspace, "usms.xml")
)
summary(sim,obs = obs, stats = c("EF", "RMSE"))
Returns:
# A tibble: 2 × 5
group situation variable EF RMSE
<chr> <chr> <chr> <dbl> <dbl>
1 Version_1 all_situations lai_n 0.636 0.631
2 Version_1 all_situations masec_n 0.871 0.945
I propose to remove the "situation" column in this case to get:
# A tibble: 2 × 5
group variable EF RMSE
<chr> <chr> <dbl> <dbl>
1 Version_1 lai_n 0.636 0.631
2 Version_1 masec_n 0.871 0.945
And in this case we should we also remove the "group" variable.
What we could do is:
if (length(unique(df$variable)) == 1){
select(df, -variable)
}
if (length(unique(df$group)) == 1){
select(df, -group)
}
- Lenguaje dominante
- R
- Estrellas
- 1
- Forks
- 3
- Merge medio
- 9 h 41 min
- PR fusionados (30 d)
- 2
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 SticsRPacks/CroPlotR
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
SticsRPacks/CroPlotR#185 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
SticsRPacks/CroPlotR#180 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
SticsRPacks/CroPlotR#186 ·
-
Error is raised if not any var in data.frames in sim_list of a stics_wrapper returned objectAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 57/100
SticsRPacks/CroPlotR#181 ·
-
enhancement
Dificultad 3/5 Medio día Aptitud para principiantes 64/100
SticsRPacks/CroPlotR#173 ·
Todos los issues de SticsRPacks/CroPlotR
Issues similares
-
1.7
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pharmaverse/admiral#3235 ·
Los mantenedores suelen responder en 2 días
-
Typo: p.381Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
rmcelreath/rethinking#482 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día