Recent Releases of RWDataPlyr
RWDataPlyr - v0.6.4
RWDataPlyr 0.6.4
Released April 17, 2020
- Updated to be compatible with dplyr v1.0.0
- Removed all uses of
dplyr::funs()as it was deprecated in dplyr v0.8.0
- R
Published by rabutler-usbr over 2 years ago
RWDataPlyr - v0.6.3
RWDataPlyr 0.6.3
Releases March 3, 2020
Bug Fixes
- Added additional test for rdf files that are not found when using
rw_scen_aggregate()(#97) - Fixed the variable name assigned to Mead.Pool Elevation inside example
rwd_aggthat is created byrwd_agg_template(examples = TRUE)(#94) - When aggregating slots, if the specified period is "eocy"", then the summary must be
NA(#101) - Now check directory exists before checking individual files exist in
rdf_aggregate()(#108)
Documentation
- Updated documentation for the
rwslot_*()functions
Under the Hood Changes
- Changed test that is expecting a data.frame with factors so that
rwd_agg()fails. Explicitly stating that strings should be factors to work with R v4.0.0. - Switched all
rwd_agg(read.csv())calls toread_rwd_agg()
- R
Published by rabutler-usbr almost 6 years ago
RWDataPlyr - v0.6.2
RWDataPlyr 0.6.2
Released August 15, 2018
Now available on CRAN
Minor Changes
- The
oFileargument ingetDataForAllScens()now defaults toNULL, so that this function conforms to CRAN policies regarding not writing to the user's home file space by default. This should not cause any backwards compatability issues since all older code will explicitly specify theoFileargument. - The default
fileargument inrwd_agg_template()is now empty, so the user must specify the file explicitly for it to be created, also to conform to the same CRAN policy. - Tests, examples, and the vignette were updated to respect this policy, by only writing to the
tempdir(), when necessary.
- R
Published by rabutler-usbr over 7 years ago
RWDataPlyr - v0.6.1
RWDataPlyr 0.6.1
Released June 8, 2018
Minor new features
- A new function,
rdf_to_rwtbl2(), was added to try and improve performance ofrdf_aggregate(), andrw_scen_aggregate(). (#85) These functions were shown to be about 6x - 7x slower thangetDataForAllScens()for the same aggregation. The new function calls a C++ version that creates the tbldf, while maintaining the same information as `rdftorwtbl(). The API for the new function is slighly different; the first argument is now a path to an rdf file, rather than an already read inrdfobject. Otherwise, the same options are available. The C++ version ofrdftotwbl()is about 20x faster than the R version. However,rdfaggregate(), andrwscenaggregate()are still about 4x slower thangetDataForAllScens()`, indicating that there is still some necesary work to get closer speeds between the two functions (#90). As part of this work, the following modifications to other functions were made:rw_scen_aggregate()andrdf_aggregate()gaincpparguments. By default,rdf_to_rwtbl2()is used, butrdf_to_rwtbl()can be foreced by settingcpp = FALSE.read_rdf()andread.rdf()gained anrdfargument. IfTRUE(default), it returns anrdfobject, otherwise it returns a character vector.- Deprecate
rdf_to_rwtbl()in favor ofrdf_to_rwtbl2() - In
rdf_to_rwtbl(),scenariois coerced into a character. Typically this is a character, but it was previously left as numeric if specified as a numeric. For easier compatability with C++ and comparsion betweenrdf_to_rwtbl()andrdf_to_rwtbl2(), it's now always a character.
rdf_aggregate()andrw_scen_aggregate()gain averboseparameter to print out the status of processing multiple scenarios, rdfs, and slots. (#82)- A new function (
rwd_agg_template()) to create a blank template (or with examples:examples = TRUE) csv file to use to createrwd_aggobjects. (#78) - A new function (
read_rwd_agg()) to read in csv files asrwd_aggobjects. (#70)
Bug fixes
- Improved
read_rdf()error messages (#86) rw_scen_aggregate()will now work with unnamedscenariosandNULLscen_namesarguments. (#81)rwslot_*functions now error if the data passed to them are not regular (January - December or October - September) (#83)- As part of this, the matrix returned by
rdf_get_slot()now has a"timespan"attribute that corresponds to the start and end values of the rdf.
- As part of this, the matrix returned by
- Updated documentation for columns returned by
rdf_aggregate()andrw_scen_aggregate(). Now it is clear that theTimestepcolumns is not returned. (#84)
- R
Published by rabutler-usbr over 7 years ago
RWDataPlyr - v0.6.0
RWDataPlyr 0.6.0
RWDataPlyr v0.6.0 includes a major revamping of how scenarios are processed and defines several new classes.
Major new features
- New functions
rw_scen_aggregate()andrdf_aggregate()added to upgrade existinggetDataForAllScens()function, which processes multiple scenarios at a time. (#51)- These two functions rely on the new
rwd_aggclass, which upgrades the exising "slot aggregation list". The advantage of the new class is a much more flexible way to summarize and aggregate RiverWare slots. (#68)- This class includes methods for
rbind(),cbind(),as, andis.
- This class includes methods for
- Helper functions to print all slots that exist in the tibble (
rwtbl_slot_names()), get the original scenario folders (rwtbl_get_scen_folder()), and get RiverWare slots names from the saved variable name (rwtbl_var_to_slot()) were added. (#50) getDataForAllScens()now always returns data invisibly, so theretFilearguement is deprecated. This function is also deprecated in favor ofrw_scen_aggregate()and/orrdf_aggregate(). (#66)- Formalized the list returned by
createSlotAggList()as aslot_agg_listclass. Created applicable constructor, which deprecatescreateSlotAggList(). Includesprint(),summary()andis./is_methods and functions. (#67) - Added check in creation to ensure all variables are unique (if specified) (#64, #62)
- However,
slot_agg_listobjects work with the deprecatedgetDataForAllScens(), sorwd_aggobjects are preferable.
- These two functions rely on the new
- Added
read_rw_csv()to read csv files created from RiverWare or RiverSMART. (#30) - Added
rdf_to_rwtbl()to convert rdf objects (read in fromread.rdf()) to tibble objects. (#30) - Added
rdfclassread.rdf()now returns an object with an rdf class- Functions that expected rdf lists now expect an rdf object, e.g.,
rdfSlotToMatrix().
Switched to snakecase for all new functions and replaced existing functions with snakecase versions. (#76)
| Old Function | New Function | | ------------ | ------------ | |
getSlotsInRdf()|rdf_slot_names()| |makeAllScenNames()|rw_scen_gen_names()| |rdfSlotToMatrix()|rdf_get_slot()| |sumMonth2Annual()|rwslot_annual_sum()| |getTimeSpan()|rdf_get_timespan()| |getWYFromYearmon()|ym_get_wateryear()| |getMaxAnnValue()|rwslot_annual_max()| |getMinAnnValue()|rwslot_annual_min()| |flowWeightedAvgAnnConc()|rwslot_fwaac()|- For
flowWeightedAvgAnnConc(), because it is rarely used it was converted to an internal function:trace_fwaac(). Then createdrwslot_fwaac()that is exported and follows the input/output format ofrwslot_annual_min()andrwslot_annual_max().
- For
Added the
rwdataplyr-workflowvignette. Browse withvignette("rwdataplyr-workflow", package = "RWDataPlyr").
Minor improvements
- For monthly data,
getDataForAllScens()will use full month name in theMonthcolumn. This change could break existing code if there are checks for particular months. (#20) - Thresholds < 1 will now work for aggregation methods that compute <=/>= for
slot_agg_listandgetDataForAllScens(). (#14) - Removed dependency on reshape2 and converted to use dplyr where appropriate.
- Got rid of
read.rdf()'s original implementation. Nowread.rdf2()(the faster implementation) is namedread.rdf()andread.rdf2()is deprecated. (#63)read.rdf()now works with rdf files that contain scalar slots (#52)read_rdf()is added as an alias.
- R
Published by rabutler-usbr almost 8 years ago
RWDataPlyr - v0.5.0
RWDataPlyr 0.5.0
Released May 26, 2017
Major new features
- Modified all aggregation methods that check if the data are <, <=, >, or >= a threshold. Previously, these aggregation methods returned either 0 (FALSE) or 100 (TRUE), now they return 1 for TRUE. This allows us to keep data in its original state before plotting with
scales::percent, and keep us from having to multiply/divide by 100 if we compute other averages outside of RWDataPlyr. However, this will cause any plotting code that is expecting percentages between 0 and 100 instead of between 0 and 1 to break (or at least look weird). (#53) - Added
findAllSlotsboolean parameter togetDataForAllScens()- If this is
TRUEan error will post if one or more of the slots cannot be found. If it isFALSE, then it will fill in the data frame with-99, but not fail. (#38)
- If this is
- New function:
makeAllScenNames()will create scenario names for vectors of multiple dimensions. - New function:
getWYFromYearmon()will take ayearmonobject and determine the water year it falls into. - Added
WYMaxLTEas a valid aggregation method. This will compare the maximum value in a water year to a threshold and determine if it is less than or equal to the threshold.
Minor improvements
- Better error messages in
createSlotAggList()(#45) - Improved the error message if an invalid aggregation method is passed to
processSlots()(#42) - Ensure that
getDataForAllScens()(and interal functionprocessSlots()) work with rdf files that only include one trace of data (#40) getDataForAllScens()throughprocessSlots()now returns the same type/class forYearandVariablecolumns for both annual and monthly data.Year is a numeric andVariableis always a character. This could affect code that does not read the data frame back in and assumes that Variable is a factor. (#54)
Under-the-hood improvements
- Improved tests for
createSlotAggList() - Added tests for
RWDataPlyr:::processSlots() - Now check for invalid aggregation methods in
createSlotAggList(), so it will not wait untilprocessSlots()is called to throw the error.
- R
Published by rabutler over 8 years ago
RWDataPlyr - v0.4.1.1
This version is actually called RWDataPlyr.
The only difference between v0.4.1 and v0.4.1.1 is the name of the package.
- R
Published by rabutler over 9 years ago
RWDataPlyr - v0.4.1
v0.4.1 mostly includes internal updates, including more tests, and smaller example rdf files. However, there are several user side updates:
- new function: getTimeSpan
- new aggregation method: BOCY - returns the beginning of year value from monthly data
- removed the listSlots function. It has been replaced with getSlotsInRdf
Additionally, xts capabilities and functions were merged into the packages (PR #16). However, none of these functions are exported yet, as they have not been sufficiently tested.
- R
Published by rabutler over 9 years ago
RWDataPlyr - version 0.4
Major Enhancements
- read.rdf2 is faster version of read.rdf
- lots of tests
- getSlotsInRdf replaces listSlots
- can now create a data frame from all slots in an rdf file instead of having to create the slot aggregation list to do so (#10)
- getDataForAllScens is now a bit smarter when there are timestep discrepancies between the rdf data and the user specified aggregation method (#17)
- getDataForAllScens can now write out .csv and .feather files in addition to .txt files.
Issues Closed - #1 - #2 - #5 - #8
- R
Published by rabutler over 9 years ago
RWDataPlyr - version 0.3
Version 0.3 includes 2 additional aggregation methods: - end-of-calendar year value is less than or equal to a threshold (EOCYLTE) - end-of-calendar year value is greater than or equal to a threshold (EOCYGTE)
- R
Published by rabutler almost 10 years ago