NIEHS / amadeus

https://niehs.github.io/amadeus/
Other
6 stars 2 forks source link

`calc_narr` replace "level=" #71

Closed mitchellmanware closed 3 months ago

mitchellmanware commented 5 months ago

When the name string (containing pressure levels) is split, the "level=" is retain and returned in the $level column.

 shum_covariates_wrapper
      id       time      level     shum_100
1  loc_1 2022-01-01 level=1000 1.435557e-02
2  loc_1 2022-01-01  level=975 1.323741e-02
3  loc_1 2022-01-01  level=950 1.266798e-02
4  loc_1 2022-01-01  level=925 1.256814e-02
5  loc_1 2022-01-01  level=900 1.178267e-02
6  loc_1 2022-01-01  level=875 1.083267e-02
7  loc_1 2022-01-01  level=850 9.736534e-03
8  loc_1 2022-01-01  level=825 8.581291e-03

To do: gsub("level=", "", x$level) and check MERRA2 + GEOS for similar

mitchellmanware commented 5 months ago

See commit ea43e5afd5521ae9d06490c9146d2af34d6ca919

sigmafelix commented 5 months ago

Do we prefer a long table with all levels in a field or a wide table with all levels spread across several fields?

mitchellmanware commented 5 months ago

@sigmafelix I used long data frame as I personally find the data frame manipulation if the "level" data is its own field and not embedded in the column names. Retention in the column names has obvious benefits for easy of interpretation. I can add a choice for long or wide .