Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfd() functions and methods #83

Open
7 of 12 tasks
rabutler-usbr opened this issue May 27, 2020 · 0 comments
Open
7 of 12 tasks

nfd() functions and methods #83

rabutler-usbr opened this issue May 27, 2020 · 0 comments

Comments

@rabutler-usbr
Copy link
Contributor

rabutler-usbr commented May 27, 2020

  • need to change the default n_sites in nfd(). It should default to NA. If it is NA, then it will compute n_sites based on dimensions of data, unless length(data) == 1, in which case it will be 1. Right now when calling nfd() on a matrix etc. you get a warning b/c the default n_sites is set to 1, but then it is computed.
  • A function that will update the nfd object to contain annual data if only monthly data exist
  • A function to convert intervening to total. Definitely should work for crssi and crss_nf objects. Can only work with nfd objects if we somehow provide a formula. (nf_to_total() #101)
  • Function to convert from total to intervening. (convert total to intervening natural flow #105)
  • define head.nfd() to get a peep at the actual data. ... can be used to specify flow_space and time_step. if they are not specified, then will show only 1. Will check in this order and show the first data that exist: annual-total, annual-intervening, monthly-total, monthly-intervening. Also need to specify trace; maybe this is always 1, as it is head.
    • should probably do tail too.
  • How do we combine multiple nfd objects. For example, it would be good to be able to take two nfd objects with the same number of traces and timesteps and combine them by flow_type. Or to take two with the same flow types and combine by timestep or number of traces. c() vs rbind() vs cbind() vs merge()? Or defininig our own more intuitive/explicit names, e.g., nfd_c_traces(), nfd_c_flow_type
  • how do we make a [ or [[ method similar to nfd_extract()
  • as.matrix.nfd()
  • as.data.frame.nfd()
    • wide = TRUE puts sites as columns, otherwise puts them as attribute.
  • as.array.nfd()
    • as.array(x["1906/1999", , ,"monthly", "int"])
    • returns 3d or 4d. Will only work if time_step is one or the other, but will work for both flow_sapce
  • nfd_get_*() nfd_get_* functions #84
  • enhance nfd() constructor to work with lists and data frames Extend nfd() to work with lists and data frames #82
rabutler-usbr added a commit to rabutler-usbr/CRSSIO that referenced this issue Mar 22, 2021
rabutler-usbr added a commit to rabutler-usbr/CRSSIO that referenced this issue Mar 23, 2021
- changed signature to match base method
- added tests to make sure the `date` variable is being set correctly
- added examples to calling `as.data.frame.nfd/crssi()`

BoulderCodeHub#83
rabutler-usbr added a commit to rabutler-usbr/CRSSIO that referenced this issue Mar 23, 2021
rabutler-usbr added a commit to rabutler-usbr/CRSSIO that referenced this issue Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant