carminat (49) [Avatar] Offline
#1
I would like to use the stats command on a file containing time data, but I get the error message:
"Stats command not available in timedata mode"

I agree that not all stats operations make sense in this case, and yet such a command would be indeed useful
(especially for the detection of invalid/incomplete/missing records)

I tried to force gnuplot to interpret the date as if it were a number using Unix time:
stats "2016c.csv" u (timecolumn(3,"%d/%m/%Y")) nooutput
but it did not work.

Is there a workaround?

PS: [a metaquestion regarding this forum] when I post a question/comment it often happens that it does not appear. I can retrieve it using the "back" browser button, so I usually re-post it a second time (and it always works). Is it just my problem?
philipp.janert (286) [Avatar] Offline
#2
You should be able to use the stats command outside of timeseries mode, even if the data is, in fact, time series data. So:

set xdata
stats "file" u 1
set xdata time
plot "file" u 1:2

or whatever...

Limiting the stats command to a single column may be useful in this situation (but you are doing this already).

Regarding the meta-question: please let the publisher/maintainer know. There is a "feedback" button on the
login page - try that.
carminat (49) [Avatar] Offline
#3
Thanks! Actually it works ...

And yet I am not completely satisfied: applying stats to time series is indeed useful to spot if there are missing data, but I would like gnuplot to translate time stamps into numbers (unix time), so that I can accomplish the following:
* spot malformed data;
* using stats with all its features.

One curious issue: if time stamps are in the form 31/12/2016, the command stats computes the average of the day field (giving a result like "Mean: 15.6236").

Another (probably related) issue is the following: is it possible to use the directive "smooth kdensity" for time series? I did not succeed so far...