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

Error - ContDataQC (sporadic finite) and SummaryStats (tapply not same length) #60

Closed leppott closed 5 years ago

leppott commented 6 years ago

I’m trying to use the updated R script to run the QC, Aggregate and Summary Stats scripts on all of our RMN data for all 3 sites and I’m encountering two issues that I was hoping you might be able to help with.

When running the QC script, there is one file that gives this error - Error in seq.int(0, to0 - from, by) : 'to' must be a finite number

All file names are formatted the same and it appears that the data formatting/headers inside all files are identical too… it works on all files except one (out of 5), and I’m getting this error for the same date range for all 3 sites; otherwise it works great on all other files

Aggregate function works fine but When I try to run the Summary Stats function I get the following error - Error in tapply(currVAR, rh.string.factor, function(x) { : arguments must have same length

JK

email 2018-05-07

leppott commented 6 years ago

2018-05-11

Thanks for sending the files.

The first Dunfield file runs fine on my machine for both the QC and SummaryStats portion of the code. I did not try the file without running the QC portion on my end.

For the other 3 files I am getting the same error you received. I’ll have to dig a bit more (i.e., step through the code) to see where it fails (and why). I ran a quick data summary and there wasn’t anything untoward about it. The dates look file, no blanks, some negatives but that should be ok.

Attached are the DataExplorer reports I ran on the data files along with the R notebook I used for testing of the files.

Just keeping you in the loop. I’ll work in looking at it as I can but not sure of timetable.

Erik

leppott commented 6 years ago

20180823

I just wanted to let you know that I figured out what the issue was (see below), in case you come across it again at any point. The issue with the one file was that there were columns for discrete data with no data in them, which was apparently messing up the program. Once I removed the 2 discrete data columns, the script ran perfectly!

Cheers, JK

leppott commented 6 years ago

20180823

I made it up to the Summary Stats script with no additional issues, but now when I try to run Summary Stats, I get the following error:

image

I noticed that in the Aggregated data file there are NA’s in the Air Temp column but none in the Water Temp column.. not sure if this is the issue, but I did try to remove all rows with NA’s in the Air Temp column and I still got the same error. Just figured I’d throw it out there in case you had a quick solution.

Thanks! JK

leppott commented 5 years ago

Still an issue, v2.0.2.9004

leppott commented 5 years ago

doBy::summaryBy function had error.

No space around tilde (~) caused the error.

Fixed by adding spaces and explicitly converted analyte to numeric and date to date format.

image

leppott commented 5 years ago

summaryBy is used many times in the function. Had to modify each one.

leppott commented 5 years ago

image

Example of change.

leppott commented 5 years ago

Fixed summary Stats.

Still have "finite" issue but cannot duplicate.