Remove the situation column from `summary` when all_situations=FALSE

オープン
#6 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
r
領域
data

調査の方向性

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.

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

説明

enhancement

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)
}
主要言語
R
スター
1
フォーク
3
平均マージ
9時間 41分
マージ済み PR(30日)
2

環境構築

はじめの一歩

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

SticsRPacks/CroPlotR のほかの issue

SticsRPacks/CroPlotR の issue をすべて見る

似ている issue

R の issue をもっと見る

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

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