BoulderCodeHub / RWDataPlyr

R package to read and manipulate data from RiverWareTM
3 stars 5 forks source link

Should data frame be in tidy format #39

Closed rabutler closed 6 years ago

rabutler commented 8 years ago

I think so. Changing this format would be a code breaking change, so best wait until changing the package name occurs.

Also, check and see if there are any size on disk benefits.

rabutler commented 7 years ago

I think there are two issues: 1) should the dataframe returned by getDataForAllScens be a tbl 2) should this dataframe be in tidy format, i.e., not a "Variable" column name, but move those to additional columns.

For 1, I think yes? It happens after the dataframe is modified by dplyr anyways, so might as well start there.

For 2, I'm not convinced yet. This would break a TON of code, and it is nice to be able to plot multiple variables on the same plot.

rabutler commented 7 years ago

For 1: if you make it a tibble, the unit tests fail. Not sure why, so for now, keeping a data.frame.

I tried creating the tibble in processSlots() by placing as_tibble() around the two tibble::rownames_to_column(...) statements.

rabutler commented 6 years ago

rw_scen_aggregate() is replacing getDataForAllScens() and it returns a tbl_df. Don't need to do anything more for now.