nationalparkservice / EnvironmentalSetting_Toolkit

Tools supporting the NPS IMD Environmental Setting protocol
Other
3 stars 2 forks source link

Fix request for micro-drought (CSP3) #17

Closed llnelson closed 6 years ago

llnelson commented 6 years ago

modify formatWxObservations() for nested missing values at row # 444 (ack)

matrix(unlist(lapply(rList$data, "[", itemCount + 1)), ncol = 2, byrow = TRUE)[, 1] where rList$data row like["1957", ["29", "1957-09-06", 2, 0]], instead of["1957", ["11", 2]],

The date is messing with the unlist and lapply operations

llnelson commented 6 years ago

Argh - hours later...

Response is a dataframe with a nested list:

$ pcpn_in_runYear     : chr  "1957" "1958" "1959" "1960" ...
$ pcpn_in_run         :List of 61
  ..$ : chr [1:42, 1:2] "29" "24" "22" "21" ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr  "pcpn_in_run_le_0.1" "pcpn_in_runEndDate"
$ pcpn_in_countMissing: chr  "2" "1" "0" "0" ...

Not ideal but will work for now.