trinker / qdap

Quantitative Discourse Analysis Package: Bridging the gap between qualitative data and quantitative analysis
http://cran.us.r-project.org/web/packages/qdap/index.html
175 stars 44 forks source link

Document like functions together: #90

Closed trinker closed 11 years ago

trinker commented 11 years ago

Dason's example:

#' blah 1
#' 
#' fun1 - blah 2
#' 
#' @param X Something called X
#' @param ... those crazy dots
#' @rdname together
#' @export
fun1 <- function(X, ...){
    print("fun1")
}

#' blah 2
#' 
#' fun2 - blah2
#' 
#' @param simplify shut yo face
#' @inheritParams fun1
#' @rdname together
#' @export
fun2 <- function(X, simplify = FALSE, ...){
    print("fun2")
}

#' blah 3
#' 
#' fun3 - blah 3
#' 
#' @param noargs no arguments
#' @inheritParams fun1
#' @rdname together
#' @export
fun3 <- function(X, noargs = TRUE, ...){
    print("fun3")
}

I'd recommend throwing together a silly skeleton package called "test" or something for anytime you want to just test things out. But if you roxygenize this and then look at the help file it looks like this:

fun1                   package:test                    R Documentation

blah 1

Description:

     fun1 - blah 2

     fun2 - blah2

     fun3 - blah 3

Usage:

       fun1(X, ...)

       fun2(X, simplify = FALSE, ...)

       fun3(X, noargs = TRUE, ...)

Arguments:

       X: Something called X

     ...: those crazy dots

simplify: shut yo face

  noargs: no arguments

@DASON: Also note that when you use @inheritParams you don't have to be inheriting all the parameters. What this basically let's you do is be lazy so that if you're using essentially the same parameters you don't need to document them over and over. It's very nice for the purpose you want to do (where you have a bunch of functions in the same file) so that you don't write contradictory information for a parameter in different roxygen statements. I don't even know what roxygen does in that case.

trinker commented 11 years ago

Start with readability:

#' \code{\link[qdap]{SMOG}}, 
#' \code{\link[qdap]{flesch_kincaidg}},
#' \code{\link[qdap]{frey}},
#' \code{\link[qdap]{coleman_liau}},
#' \code{\link[qdap]{linsear_write}},

flesh, frey and lw are left

trinker commented 11 years ago

Groups

pos (DONE):

pos
pos.by
pos.tags
print.pos
print.pos.by

wfm:

word.freq.matrix
wfm
word.freq.df
wfdf
wfm.expanded
wfdf.combine

code matrix:

cm...

diversity (not documenting together ad KL is not diversity):

diversity
kullback.leibler

replace:

replace_abbreviation
replace_number
replace_symbol

viewing:

qview
truncdf
htruncdf
left.just
right.just
strWrap

brackets (DONE):

bracketX
bracketXtract

Partitioning

sentSplit
sentCombine
speakerSplit

stemming

stemmer
stem2df

syllabication (DONE)

syllable.sum
syllable.count
pollysyllable.sum
combo_syllable.sum

termco (DONE)

termco.a
termco.d
termco.c
termco2matrix
term.match
trinker commented 11 years ago

parsing tools

qprep
bag.o.words
strip
breaker
word.split
Trim
clean
scrubber

outlier

outlier.labeler
outlier.detect

replacement

lookup
mgsub
text2color

multi csv

mcsv_w
mcsv_r

gantt (documentation done decided to keep separate)

gantt_plot
gantt
gantt_wrap
gantt_rep