useDynLib(diveMove, run_quantile)

## From standard packages
import(methods)                         # Paranoid measure
importFrom(stats4, mle, coef)
importFrom(graphics, abline, arrows, axTicks, axis, axis.POSIXct, box,
           contour, curve, hist, image, legend, lines, locator,
           mtext, par, plot, points, rect, rug, segments, text)
importFrom(grDevices, colorRampPalette, contourLines, dev.off, hsv, rgb)
importFrom(plotly,
           plot_ly, add_lines, add_markers, subplot, "%>%")
importFrom(stats, approx, approxfun, bw.nrd, ecdf, lm, median, nls,
           nls.control, predict, quantile, sd, smooth.spline, splinefun)
importFrom(utils, read.csv)

## bkde2d and rq for speed calibration
importFrom(KernSmooth, bkde2D)
importFrom(quantreg, rq)
## unireg for dive phase identification
importFrom(uniReg, unireg)
## distance algorithms
importFrom(geosphere, distMeeus, distVincentyEllipsoid)

export("grpSpeedFilter",
       "rmsDistFilter",
       "austFilter",
       "logit",
       "unLogit",
       "boutfreqs",
       "boutinit",
       "bouts2.nlsFUN",
       "bouts2.nls",
       "bouts3.nlsFUN",
       "bouts3.nls",
       "labelBouts",
       "bouts2.mleFUN",
       "bouts2.ll",
       "bouts2.LL",
       "bouts.mle",
       "calibrateDepth",
       "calibrateSpeed",
       "rqPlot",
       "distSpeed",
       "diveStats",
       "oneDiveStats",
       "plotBouts2.cdf",
       "readLocs",
       "readTDR",
       "createTDR",
       "stampDive")

exportClasses("TDR",
              "TDRspeed",
              "TDRcalibrate",
              "diveModel")

exportMethods("as.data.frame",
              "as.TDRspeed",
              "timeBudget",
              "coerce",
              "depth<-",
              "speed<-",
              "ccData<-",
              "getCCData",
              "getDepth",
              "getDAct",
              "getDPhaseLab",
              "getDiveDeriv",
              "getDiveModel",
              "getDtime",
              "getFileName",
              "extractDive",
              "getGAct",
              "plotTDR",
              "plotDiveModel",
              "plotZOC",
              "show",
              "getTDR",
              "getTime",
              "getSpeedCoef",
              "getSpeed",
              "plotBouts",
              "bec2",
              "bec3")
