leppott / ContDataQC

Quality control checks on continuous data. Example data is from a HOBO data logger with 30 minute intervals.
https://leppott.github.io/ContDataQC/
MIT License
20 stars 10 forks source link

Period Stats - more complex plots #76

Closed leppott closed 5 years ago

leppott commented 5 years ago

Is your feature request related to a problem? Please describe. For the plots, is there a place in the code where you can request it to show something other than daily means? I looked and couldn’t find any places that specified the statistic.

It’d be cool if I could make plots in PeriodStats like the ones in the PDFs from SumStats (that show mean, min and max) but I don’t know if that’d be feasible.

Describe the solution you'd like Additional detail to plots.

Describe alternatives you've considered Similar to SumStats.

Additional context Low priority.

leppott commented 5 years ago

Calculates multiple stats. But only plots mean in the report.

image

leppott commented 5 years ago

Need to decide if want a color band for Min and Max.

Code from fun.Stats.R

   myCol <- "gray"
    lines(stats.i$max,col=myCol)
    lines(stats.i$min,col=myCol)
    polygon(c(1:nrow(stats.i),rev(1:nrow(stats.i))),c(stats.i$max,rev(stats.i$min)),col=myCol,border=NA)
leppott commented 5 years ago

Testing

fn.x <- "DATA_period_test2_Aw_20130101_20141231_PeriodStats_2013-09-30_Sensor.Depth.ft_1y_20190109_140255.csv" df.x <- read.csv(fn.x) str(df.x) 'data.frame': 158 obs. of 19 variables: $ Date : Factor w/ 158 levels "2013-04-26","2013-04-27",..: 1 2 3 4 5 6 7 8 9 10 ... $ Sensor.Depth.ft.mean : num 0.859 1.019 1.654 1.69 1.291 ... $ Sensor.Depth.ft.median: num 0.855 1.036 1.736 1.66 1.278 ... $ Sensor.Depth.ft.min : num 0.838 0.866 1.011 1.424 1.183 ... $ Sensor.Depth.ft.max : num 0.985 1.1 2.521 2.106 1.433 ... $ Sensor.Depth.ft.range : num 0.147 0.234 1.51 0.682 0.25 ... $ Sensor.Depth.ft.sd : num 0.0255 0.0656 0.5634 0.1979 0.0697 ... $ Sensor.Depth.ft.var : num 0.000652 0.0043 0.317414 0.039184 0.004865 ... $ Sensor.Depth.ft.cv : num 0.0297 0.0643 0.3407 0.1172 0.054 ... $ Sensor.Depth.ft.n : int 27 48 48 48 48 48 48 48 48 48 ... $ Sensor.Depth.ft.q.1. : num 0.841 0.866 1.013 1.427 1.186 ... $ Sensor.Depth.ft.q.5. : num 0.849 0.871 1.022 1.445 1.196 ... $ Sensor.Depth.ft.q.10. : num 0.852 0.895 1.026 1.46 1.213 ... $ Sensor.Depth.ft.q.25. : num 0.853 1.024 1.033 1.525 1.231 ... $ Sensor.Depth.ft.q.50. : num 0.855 1.036 1.736 1.66 1.278 ... $ Sensor.Depth.ft.q.75. : num 0.857 1.056 2.154 1.858 1.347 ... $ Sensor.Depth.ft.q.90. : num 0.86 1.08 2.4 1.98 1.39 ... $ Sensor.Depth.ft.q.95. : num 0.862 1.092 2.474 2.018 1.408 ... $ Sensor.Depth.ft.q.99. : num 0.953 1.099 2.514 2.067 1.422 ... plot(df.x[,1:2])

image

leppott commented 5 years ago

Add polygon for min and max. Have to replot points over the polygon.

myCol <- "gray" lines(df.x[,4], col=myCol) lines(df.x[,5], col=myCol) polygon(c(1:nrow(df.x),rev(1:nrow(df.x))),c(df.x[,5],rev(df.x[,4])),col=myCol,border=NA) points(df.x[,1:2])

image

leppott commented 5 years ago

v2.0.5.9018, 2019-03-26

https://github.com/leppott/ContDataQC/commit/cdc0fa8e2314d0bef4c1ff454c28f468e45cce0c

image