Commit ea2cd832 authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

replace plot_na_ts by plot_notna_ts

parent c3702076
...@@ -5,7 +5,7 @@ export(basic_info) ...@@ -5,7 +5,7 @@ export(basic_info)
export(basic_ts) export(basic_ts)
export(plot_boxwhisk_ts) export(plot_boxwhisk_ts)
export(plot_lmrd) export(plot_lmrd)
export(plot_na_ts) export(plot_notna_ts)
export(plot_qq) export(plot_qq)
export(plot_qqRes) export(plot_qqRes)
export(plot_tbl_basic) export(plot_tbl_basic)
......
#' plot_na_ts #' plot_notna_ts
#' plot_na_ts #' plot_notna_ts
#' @param x object of class tbl_friendlyts #' @param x object of class tbl_friendlyts
#' @param fromDate fromDate #' @param fromDate fromDate
#' @param toDate toDate #' @param toDate toDate
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
#' @export #' @export
#' @examples #' @examples
#' \dontrun{ #' \dontrun{
#' plot_na_ts() #' plot_notna_ts()
#' } #' }
plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UTC",path=tempdir(),name=NULL,width_mm=200,height_mm=200,DESKTOP=TRUE){ plot_notna_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UTC",path=tempdir(),name=NULL,width_mm=200,height_mm=200,DESKTOP=TRUE){
# sub-period # sub-period
...@@ -29,9 +29,6 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT ...@@ -29,9 +29,6 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT
df <- friendlyts::dfts(tbl_fts=tmp,timeResolution=timeResolution,tzone=tzone) df <- friendlyts::dfts(tbl_fts=tmp,timeResolution=timeResolution,tzone=tzone)
df[["date"]] <- as.POSIXct(df[["date"]]) df[["date"]] <- as.POSIXct(df[["date"]])
# cat("df \n")
# print(df)
target <- setdiff(names(df), "date") target <- setdiff(names(df), "date")
tmp <- lapply(target,function(y) { tmp <- lapply(target,function(y) {
...@@ -44,9 +41,6 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT ...@@ -44,9 +41,6 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT
tmp <- do.call("rbind",tmp) tmp <- do.call("rbind",tmp)
tmp <- data.frame(date=tmp[,"date"],notna=tmp[,"notna"]*as.integer(as.factor(tmp[,"target"])),target = as.factor(tmp[,"target"])) tmp <- data.frame(date=tmp[,"date"],notna=tmp[,"notna"]*as.integer(as.factor(tmp[,"target"])),target = as.factor(tmp[,"target"]))
# cat("tmp \n")
# print(head(tmp))
#start plot #start plot
if (!(DESKTOP)) { if (!(DESKTOP)) {
...@@ -66,8 +60,12 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT ...@@ -66,8 +60,12 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT
p <- ggplot2::ggplot(tmp, ggplot2::aes(x=date,y=notna,colour=target)) + p <- ggplot2::ggplot(tmp, ggplot2::aes(x=date,y=notna,colour=target)) +
ggplot2::geom_point() + ggplot2::geom_point() +
ggplot2::labs(x = "date",y = "") #+ ggplot2::labs(x = "date",y = "non-missing values") +
#ggplot2::theme(axis.line.y=ggplot2::element_blank(),axis.text.y=ggplot2::element_blank()) ggplot2::theme(
axis.line.y=ggplot2::element_blank(),
axis.text.y=ggplot2::element_blank(),
panel.grid.major = ggplot2::element_blank(),
panel.grid.minor = ggplot2::element_blank())
print(p) print(p)
......
% Generated by roxygen2: do not edit by hand % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_na_ts.R % Please edit documentation in R/plot_na_ts.R
\name{plot_na_ts} \name{plot_notna_ts}
\alias{plot_na_ts} \alias{plot_notna_ts}
\title{plot_na_ts \title{plot_notna_ts
plot_na_ts} plot_notna_ts}
\usage{ \usage{
plot_na_ts(x, fromDate = NULL, toDate = NULL, timeResolution = NULL, plot_notna_ts(x, fromDate = NULL, toDate = NULL,
tzone = "UTC", path = tempdir(), name = NULL, width_mm = 200, timeResolution = NULL, tzone = "UTC", path = tempdir(),
height_mm = 200, DESKTOP = TRUE) name = NULL, width_mm = 200, height_mm = 200, DESKTOP = TRUE)
} }
\arguments{ \arguments{
\item{x}{object of class tbl_friendlyts} \item{x}{object of class tbl_friendlyts}
...@@ -31,12 +31,12 @@ plot_na_ts(x, fromDate = NULL, toDate = NULL, timeResolution = NULL, ...@@ -31,12 +31,12 @@ plot_na_ts(x, fromDate = NULL, toDate = NULL, timeResolution = NULL,
\item{DESKTOP}{boolean} \item{DESKTOP}{boolean}
} }
\description{ \description{
plot_na_ts plot_notna_ts
plot_na_ts plot_notna_ts
} }
\examples{ \examples{
\dontrun{ \dontrun{
plot_na_ts() plot_notna_ts()
} }
} }
\keyword{friendlyts} \keyword{friendlyts}
...@@ -69,7 +69,7 @@ tmp <- luft %>% select(names(luft)) %>% ...@@ -69,7 +69,7 @@ tmp <- luft %>% select(names(luft)) %>%
```R ```R
basicr::plot_na_ts(x=tmp,timeResolution=timeResolution,DESKTOP=TRUE) basicr::plot_notna_ts(x=tmp,timeResolution=timeResolution,DESKTOP=TRUE)
``` ```
......
Markdown is supported
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