Skip to content

Commit

Permalink
adding doc and optional args
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan S Read committed Jul 10, 2014
1 parent 797cebb commit b6cbb6f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
34 changes: 31 additions & 3 deletions R/clean.data.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#'@title cleans sensor data with user-specified routines
#'@description
#'cleans sensor data according to details within the user-specified config (*yml) file \cr
#'
#'@param deploy a string for the *.yml file name
#'@param folder a string which specifies the folder of the *.yml file
#'@param plot.diagnostic a boolean for creating a diagnostic plot
#'@param write.file a boolean for creating a timeseries file output
#'@return An optional plot and optional file output handle
#'@keywords methods
#'@author
#'Jordan S. Read
#'@examples
#'\dontrun{
#'clean.data(deploy='pellerin',folder='/[User]/Desktop/Science Projects/sensorQC/',plot.diagnostic=FALSE)
#'clean.data(deploy='pellerin',folder='/[User]/Desktop/Science Projects/sensorQC/',plot.diagnostic=TRUE,write.file=TRUE)
#'}
#'@export
clean.data <- function(deploy='pellerin',folder='../examples/'){
clean.data <- function(deploy='pellerin',folder='../examples/',plot.diagnostic=TRUE, write.file= FALSE){
#is an example wrapper for sensorQC calls

#
Expand All @@ -23,8 +40,19 @@ clean.data <- function(deploy='pellerin',folder='../examples/'){
old.inst.flags <- build_flags(data.in=windowed.data,sqc=simple.sqc$outlier_removal,verbose=F)
old.sensor <- block_stats(windowed.data=windowed.data,old.inst.flags)

plot_summary(inst.data=windowed.data,inst.flags,block.data=sensor.stats,block.flags,
compare.data=old.sensor,sqc=cnfg)
if (plot.diagnostic){
plot_summary(inst.data=windowed.data,inst.flags,block.data=sensor.stats,block.flags,
compare.data=old.sensor,sqc=cnfg)
}

if (write.file){
output = paste0(folder,deploy,"_sqc_out.tsv")
flat.block <- flatten_flags(block.flags)
write.out <- sensor.stats[!flat.block, ]
write.table(write.out,file=output,col.names=TRUE, quote=FALSE, row.names=FALSE, sep="\t")
}





Expand Down
34 changes: 34 additions & 0 deletions man/clean.data.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
% Generated by roxygen2 (4.0.1): do not edit by hand
\name{clean.data}
\alias{clean.data}
\title{cleans sensor data with user-specified routines}
\usage{
clean.data(deploy = "pellerin", folder = "../examples/",
plot.diagnostic = TRUE, write.file = FALSE)
}
\arguments{
\item{deploy}{a string for the *.yml file name}

\item{folder}{a string which specifies the folder of the *.yml file}

\item{plot.diagnostic}{a boolean for creating a diagnostic plot}

\item{write.file}{a boolean for creating a timeseries file output}
}
\value{
An optional plot and optional file output handle
}
\description{
cleans sensor data according to details within the user-specified config (*yml) file \cr
}
\examples{
\dontrun{
clean.data(deploy='pellerin',folder='/[User]/Desktop/Science Projects/sensorQC/',plot.diagnostic=FALSE)
clean.data(deploy='pellerin',folder='/[User]/Desktop/Science Projects/sensorQC/',plot.diagnostic=TRUE,write.file=TRUE)
}
}
\author{
Jordan S. Read
}
\keyword{methods}

0 comments on commit b6cbb6f

Please sign in to comment.