useDynLib(RHRV, .registration = TRUE)
 
export("AddEpisodes", "AnalyzeHRbyEpisodes","AnalyzePowerBandsByEpisodes",
       "AvgIntegralCorrelation", "BuildNIHR", "BuildTakensVector", "BuildTakens",
       "CalculateApEn",  "CalculateFracDim", "CalculatePowerBand","CalculateSpectrogram", 
       "CalculateRfromCorrelation", "CreateFreqAnalysis", "CreateHRVData", 
       "CreateNonLinearAnalysis", "CreateTimeAnalysis", "EditNIHR", "FilterNIHR",
       "GenerateEpisodes", "IntegralCorrelation", "InterpolateNIHR",
       "LoadApneaWFDB", "LoadBeatAscii", "LoadBeatEDFPlus", "LoadBeatPolar", 
       "LoadBeat", "LoadBeatAmbit", "LoadBeatRR", "LoadBeatSuunto", 
       "LoadBeatWFDB", "LoadBeatVector",
       "LoadEpisodesAscii", "LoadHeaderWFDB", "PlotHR", "PlotNIHR", 
       "PlotPowerBand","PlotSinglePowerBand",
       "CalculatePSD", "PlotPSD","CalculateEnergyInPSDBands",
       "getNormSpectralUnits",
       "PlotSpectrogram", "ReadFromFile", "SetVerbose",
       "SplitHRbyEpisodes", "SplitPowerBandByEpisodes", "WriteToFile",
       "CalculateEmbeddingDim","CalculateTimeLag",
       "CalculateCorrDim","EstimateCorrDim","PlotCorrDim","PoincarePlot",
       "CalculateSampleEntropy","EstimateSampleEntropy","PlotSampleEntropy",
       "CalculateMaxLyapunov","EstimateMaxLyapunov","PlotMaxLyapunov",
       "CalculateDFA","EstimateDFA","PlotDFA",
       "CalculateInfDim","EstimateInfDim","PlotInfDim",
       "RQA","RecurrencePlot","NonLinearNoiseReduction",
       "NonlinearityTests","SurrogateTest","OverplotEpisodes",
       "ExtractTimeSegment","Window","EstimatePSDSlope",
       "ListEpisodes", "RemoveEpisodes", "ModifyEpisodes"
)

importFrom("grDevices", "palette", "rainbow", "topo.colors")
importFrom("graphics", ".filled.contour", "Axis", "abline", "arrows",
           "axis", "box", "grid", "hist", "layout", "lcm", "legend",
           "lines", "par", "plot", "plot.new", "plot.window", "points",
           "polygon", "rect", "text", "title")
importFrom("stats", "IQR", "approxfun", "coef", "cov", "diffinv",
           "dist", "fft", "lm", "median", "na.fail", "qchisq",
           "quantile", "runif", "sd", "splinefun", "ts", "var")
importFrom("utils", "head", "read.table", "tail")

# Import all packages listed as Imports or Depends
import(
  waveslim,
  nonlinearTseries,
  lomb
)

