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",
       "RHRVEasy", "RHRVEasyStats", "SaveHRVIndices"
)

S3method(estimateScalingRegion,corrDim)
S3method(estimateScalingRegion,maxLyapunov)
S3method(nltsFilter,corrDim)
S3method(nltsFilter,maxLyapunov)
S3method(print,RHRVEasyResult)

# import(progress)
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",
           "aov", "formula", "kruskal.test",
           "ks.test", "ksmooth", "p.adjust", "pairwise.t.test",
           "rstandard", "shapiro.test", "t.test", "uniroot")
importFrom("utils", "head", "read.table", "tail", "capture.output")
importFrom("PMCMRplus","kwAllPairsDunnTest")
importFrom("boot","boot", "boot.ci")
importFrom("broom","tidy")
importFrom("foreach","%do%", "%dopar%", "foreach")
importFrom("iterators","iter")
importFrom("parallel","detectCores", "makeCluster")
importFrom("doParallel", "registerDoParallel")
importFrom("plotrix","clean.args")
importFrom("segmented","segmented")
importFrom("tibble","as_tibble")
importFrom("tidyr","all_of", "pivot_longer")
importFrom("writexl","write_xlsx")

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

