Remove the situation column from `summary` when all_situations=FALSE
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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)
}
- Dominant language
- R
- Stars
- 1
- Forks
- 3
- Avg merge
- 9h 41m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SticsRPacks/CroPlotR
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SticsRPacks/CroPlotR#185 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SticsRPacks/CroPlotR#180 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
SticsRPacks/CroPlotR#186 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 57/100
SticsRPacks/CroPlotR#181 ·
-
enhancement
Difficulty 3/5 Half a day Newbie friendliness 64/100
SticsRPacks/CroPlotR#173 ·
All issues in SticsRPacks/CroPlotR
Similar issues
-
1.7
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pharmaverse/admiral#3235 ·
Maintainers usually reply within 2 days
-
Typo: p.381Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
rmcelreath/rethinking#482 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day