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)
export(basic_ts)
export(plot_boxwhisk_ts)
export(plot_lmrd)
export(plot_na_ts)
export(plot_notna_ts)
export(plot_qq)
export(plot_qqRes)
export(plot_tbl_basic)
......
#' plot_na_ts
#' plot_notna_ts
#' plot_na_ts
#' plot_notna_ts
#' @param x object of class tbl_friendlyts
#' @param fromDate fromDate
#' @param toDate toDate
......@@ -16,9 +16,9 @@
#' @export
#' @examples
#' \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
......@@ -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[["date"]] <- as.POSIXct(df[["date"]])
# cat("df \n")
# print(df)
target <- setdiff(names(df), "date")
tmp <- lapply(target,function(y) {
......@@ -44,9 +41,6 @@ plot_na_ts <- function(x,fromDate=NULL,toDate=NULL,timeResolution=NULL,tzone="UT
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"]))
# cat("tmp \n")
# print(head(tmp))
#start plot
if (!(DESKTOP)) {
......@@ -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)) +
ggplot2::geom_point() +
ggplot2::labs(x = "date",y = "") #+
#ggplot2::theme(axis.line.y=ggplot2::element_blank(),axis.text.y=ggplot2::element_blank())
ggplot2::labs(x = "date",y = "non-missing values") +
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)
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_na_ts.R
\name{plot_na_ts}
\alias{plot_na_ts}
\title{plot_na_ts
plot_na_ts}
\name{plot_notna_ts}
\alias{plot_notna_ts}
\title{plot_notna_ts
plot_notna_ts}
\usage{
plot_na_ts(x, fromDate = NULL, toDate = NULL, timeResolution = NULL,
tzone = "UTC", path = tempdir(), name = NULL, width_mm = 200,
height_mm = 200, DESKTOP = TRUE)
plot_notna_ts(x, fromDate = NULL, toDate = NULL,
timeResolution = NULL, tzone = "UTC", path = tempdir(),
name = NULL, width_mm = 200, height_mm = 200, DESKTOP = TRUE)
}
\arguments{
\item{x}{object of class tbl_friendlyts}
......@@ -31,12 +31,12 @@ plot_na_ts(x, fromDate = NULL, toDate = NULL, timeResolution = NULL,
\item{DESKTOP}{boolean}
}
\description{
plot_na_ts
plot_na_ts
plot_notna_ts
plot_notna_ts
}
\examples{
\dontrun{
plot_na_ts()
plot_notna_ts()
}
}
\keyword{friendlyts}
......@@ -69,7 +69,7 @@ tmp <- luft %>% select(names(luft)) %>%
```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