Commit d64335a6 authored by jml's avatar jml
Browse files

fix when row==0

parent 4ff3a0be
Package: luftlyr
Type: Package
Version: 0.0.2
Version: 0.0.3
Authors@R: c(person("Jean-Marie", "Lepioufle", , "jml@nilu.no", role=c("aut","cre")),
person("NILU",role="cph"))
Title: luftlyr
......
......@@ -16,12 +16,16 @@ luftlyr_df_data <- function(x,res){
target <- setdiff(names(res), c(col_names,"ST_ID","ST_NAME","CO_NAME"))
tmp <- friendlyts::ts_spread(df=res, col_date=col_names,
col_key=c("CO_NAME","ST_ID"),col_target=target,
precision=x$timeObj$precision(),tzone=x$timeObj$tzone(),
date_type="df_yymmdd_hhmmss")
df <- friendlyts::check_date(tbl_fts=tmp, fromDate=x$timeObj$fromDateTime(),toDate=x$timeObj$toDateTime(),timeResolution=x$timeObj$timeResolution(), v=x$timeObj$v(), precision=x$timeObj$precision(), tzone=x$timeObj$tzone(),missingValues=NA,date_type="posixlt")
if (nrow(res)>0){
tmp <- friendlyts::ts_spread(df=res, col_date=col_names,
col_key=c("CO_NAME","ST_ID"),col_target=target,
precision=x$timeObj$precision(),tzone=x$timeObj$tzone(),
date_type="df_yymmdd_hhmmss")
df <- friendlyts::check_date(tbl_fts=tmp, fromDate=x$timeObj$fromDateTime(),toDate=x$timeObj$toDateTime(),timeResolution=x$timeObj$timeResolution(), v=x$timeObj$v(), precision=x$timeObj$precision(), tzone=x$timeObj$tzone(),missingValues=NA,date_type="posixlt")
} else {
df <- friendlyts::friendlyts(varnames="empty",date_type=c("posixlt"),fromDate=x$timeObj$fromDateTime(),toDate=x$timeObj$toDateTime(),timeResolution=x$timeObj$timeResolution(),v=x$timeObj$v(),precision=x$timeObj$precision(),tzone=x$timeObj$tzone())
}
if (x$dateStructObj$COL_DATE) {
stop("to be done")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment