### import functions from package openxlsx and xtable.
import(xtable)
import(openxlsx)
importFrom("stats",
           addmargins,
           aggregate,
           chisq.test,
           cor,
           cor.test,
           model.frame,
           na.exclude,
           na.pass,
           na.omit,
           na.fail,
           terms)

importFrom("utils",
           capture.output,
           write.table)
### Functions to export to users.
export(
    ## String utility functions (strutil.R).
    "%+%",             # Extends the add function for strings.
    "%n%",             # Repeats s n time (usage: s %n% n)
    numtostr,          # Converts a numeric to string. Used by print methods.
    ## Description of continuous variables (desc.R, corr.R, mean.table.R, xf.R).
    correlation,       # This function compute correlation matrices
                       #  and associated tests.
    ## Description of categorical variables (freq.R, cross.R).
    cross,             # This function creates a crosstab object which
                       # displays % and statistical test.
    xf,                # applies a function across a list of factors.
    xtab,              # Corrects bugs in xtabs associated with NA managements.
    freq,              # displays % of a categorical variable. 
    ## Complementary utility functions.
    ## Print methods.
    print.cross,       # Print function for freq objects.
    print.correlation, # Print function for corr objects.
    print.frequencies, # Print function for frequencies objects.
    ## Compute sums.
    sum.n,             # sumn for a minimum number of valid values.
    Total              # modification of sum that uses na.rm=TRUE as default
                       # and replaces a result of NA by 0.
    )


### Declare S3 methods.
S3method(print, cross)
S3method(print, correlation)
S3method(print, frequencies)
S3method(sum,n)

