Skip to content
Snippets Groups Projects
Commit baad5223 authored by jml's avatar jml
Browse files

typo

parent 273eeb0f
No related branches found
No related tags found
No related merge requests found
Package: friendlyts
Type: Package
Version: 0.2.3
Version: 0.2.4
Authors@R: c(person("Jean-Marie", "Lepioufle", , "jml@nilu.no", role=c("aut","cre")),
person("NILU",role="cph"))
Title: friendlyts
......
......@@ -46,18 +46,18 @@ as_tbl_friendlyts <- function(df,precision=NULL,date_col=NULL,date_type=c("frien
as_tbl_friendlyts_ <- function(df,date_col,precision,date_type=c("friendlyts","posixlt","df_yymmdd_hhmmss","%Y-%m-%d %H:%M:%S","%Y-%m-%dT%H:%M:%OSZ","%Y/%m/%d %H:%M:%S"),tzone="UTC",CHECKNAS=TRUE){
as_tbl_friendlyts_ <- function(df,date_col=NULL,precision,date_type=c("friendlyts","posixlt","df_yymmdd_hhmmss","%Y-%m-%d %H:%M:%S","%Y-%m-%dT%H:%M:%OSZ","%Y/%m/%d %H:%M:%S"),tzone="UTC",CHECKNAS=TRUE){
# extract date and colnames
if (date_type != "friendlyts") {
if ((date_type != "friendlyts") && (!is.null(date_col))) {
dateTS <- timemanip::foo2_yymmdd_hhmmss(as.data.frame(df)[,date_col],precision=precision,tz=tzone,type=date_type)
non_date_col <- setdiff(names(df), date_col)
} else {
} else if (date_type == "friendlyts") {
dateTS <- fts_yymmdd_hhmmss(df,precision=precision,tzone=tzone)
date_col <- get_date_col(precision=precision)
non_date_col <- setdiff(names(df), names(df)[date_col])
}
} else stop("date_col required.")
names(df) <- gsub("\\.","_",names(df))
date_col <- gsub("\\.","_",date_col)
......
......@@ -21,7 +21,7 @@
#' }
friendlyts <- function(path=NULL,url=NULL,df=NULL,date_col=NULL,varnames=NULL,date_type=c("posixlt","df_yymmdd_hhmmss","%Y-%m-%d %H:%M:%S","%Y-%m-%dT%H:%M:%OSZ","%Y/%m/%d %H:%M:%S"),fromDate=NULL,toDate=NULL,timeResolution=NULL,v=1,precision=NULL,tzone="UTC",CHECKNAS=TRUE){
if ((!is.null(path) || !is.null(url)) && ((!is.null(date_col)) && (!is.null(date_type)))) {
if ( (!is.null(path) || !is.null(url)) && (!is.null(date_type)) ) {
df <- import_(path=path,url=url)
res <- as_tbl_friendlyts(df=df,precision=precision,date_col=date_col,date_type=date_type,tzone=tzone,CHECKNAS=CHECKNAS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment