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

Stats - counting NA #140

Closed leppott closed 10 months ago

leppott commented 2 years ago

Describe the bug User email from 2021-11-01.

I’ve attached the stats output files for air temperature and water level and an excerpt from the aggregate file since it is so large, but you should be able to see what I’m talking about. I guess the in-water sensor malfunctioned so there was no water temperature or water level data for 2019. There was however air temperature data. Both the air temperature and water level files show n=218 for 2019 even though there were no water level values for 2019.

To Reproduce Steps to reproduce the behavior:

  1. Data file with some measurements NA.
  2. After stats getting N for all rows not just those with data (i.e., NA are counted)

Expected behavior NA should not be counted.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

leppott commented 10 months ago

SumStats.updated.R fun.Stats.R fun.Stats.File.R fun.PeriodStats.R

image

leppott commented 10 months ago

Replace length(x) with sum(!is.na(x))