I have a data set absolute time data {absolute time, species} set that looks like this
mydata = {{3558297660,74}, {3558297720,38}, {3558297780,61},
{3558297900,26}, {3558297960,100}, {3558298020,50}, {3558298080,70},
{3558298140,90}, {3558298260, 29}, {3558298320,65}, {3558298380,24},
{3558298500,67},{3558298560,80}, {3558298740,16}, {3558298800,68}};
Each time step is 60 s apart, I'm trying to create a continuous data array spaced 60 s apart with missing time entries replaced by the right time and "NA" as below
newdata = {{3558297660,74}, {3558297720,38}, {3558297780,61},
{3558297840,"NA"}, {3558297900,26}, {3558297960,100}, {3558298020,50},
{3558298080,70}, {3558298140,90}, {3558298200,"NA"}, {3558298260,29},
{3558298320,65}, {3558298380,24}, {3558298440,"NA"}, {3558298500,67},
{3558298560,80}, {3558298620,"NA"}, {3558298680,"NA"}, {3558298740,16},
{3558298800,68}};
The main reason why I have sought help of the community is that I intend to use the DateListPlot
function to plot a TemporalData
using the Joined
option which is annoying when there are gaps in the data (as it joins this point, making the plot a bit messy). I have adapted your code for what I want and was wondering if there are options in DateListPlot
to handle this. I will to plot the data using the joined option but skipping any large time gap or as replacing them with "NA"/Missing["NA"]
Missing["NA"]
instead, as that's the format easily handled by Mathematica. $\endgroup$