Description Usage Arguments Value Author(s) Examples
View source: R/fdbk_asdataframe.R
Function to convert time in format hhmm to decimal hours. Useful to calculate a derived time from two time informations
1 | hhmm2hour(x)
|
time |
in format hhmm. Can be a string or numeric |
time in decimal hours
Felix <felix.fundel@dwd.de>
1 2 3 4 5 6 7 8 9 10 11 12 13 | #EXAMPLE 1 simple examples
hhmm2hour(0145) returns 1.75
hhmm2hour(145) returns 1.75
hhmm2hour("145") returns 1.75
#EXAMPLE 2 calculate leadtime from veri_forecast_time and time
require(ggplot2)
fnames = "/Users/josuegehring/Desktop/verTEMP.2014120112"
cond = list(obs="!is.na(obs)",varno="varno%in%c(2,3,4,29)",ident="ident%in%c(6610)",varno="varno%in%c(2)")
columnnames = c("obs","veri_data","varno","state","level","veri_forecast_time","time","ident")
DT = fdbk_dt_multi_large(fnames,cond,columnnames,1)
leadtime = hhmm2hour(DT$veri_forecast_time) + DT$time/60
DT[,"leadtime"] = leadtime
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.