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, rexp, sd, smooth.spline,
           splinefun, stepfun)
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",
       ## "boutsCDF",
       "calibrateDepth",
       "calibrateSpeed",
       "rqPlot",
       "distSpeed",
       "diveStats",
       "oneDiveStats",
       "readLocs",
       "readTDR",
       "rmixexp",
       "createTDR",
       "stampDive")
## Deprecated functions
export("bouts2.nlsFUN",
       "bouts2.nls",
       "bec2",
       "bec3",
       "bouts3.nlsFUN",
       "bouts3.nls",
       "bouts2.mleFUN")
## Defunct functions
export("bouts2.ll",
       "bouts2.LL",
       "bouts.mle")

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

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