HARPgroup / hydro-tools

Houses sets of commonly used hydrologic tools
0 stars 0 forks source link

More R data frame compatibility issues? #312

Open rburghol opened 3 years ago

rburghol commented 3 years ago

IN the latest code for om_cia_table -- which is waaay streamlined and should be great -- there is a sapply that inadvertently sets all column to "1" instead of their values.

Lines 93-94:

    rseg_summary.i[] <- sapply(rseg_summary.i[],as.numeric) #MAKE ALL FIELDS NUMERIC
    rseg_summary.i <- rseg_summary.i %>% mutate_if(is.numeric, round, digits=2) #ROUND ALL FIELDS  

Here is an example:

rseg_summary.i
             Qout       Qbaseline remaining_days_p0  l30_Qout  l90_Qout
1 1148.7732799744 1155.1814309876                NA 19.246947 67.462134
  consumptive_use_frac wd_cumulative_mgd ps_cumulative_mgd
1   0.0055473113064593   5.8435414194962   1.7012330722892

as.numeric(rseg_summary.i)
[1] 1 1 1 1 1 1 1 1