## S3 method for class 'default':
DescWrd(x, wrd, main = deparse(substitute(x)),
plotit = getOption("plotit", FALSE), ...)
## S3 method for class 'data.frame':
DescWrd(x, wrd, main = NULL,
plotit = getOption("plotit", FALSE), enum = TRUE, ...)
## S3 method for class 'list':
DescWrd(x, wrd, main = NULL,
plotit = getOption("plotit", FALSE), enum = TRUE, ...)
## S3 method for class 'formula':
DescWrd(formula, data = parent.frame(), subset = TRUE, wrd,
plotit = getOption("plotit", FALSE), ...)
GetNewWrd()
or an existing one, created by GetCurrWrd()
.
Default is the last created pointer stored in getOption("lastWord")
.lhs ~ rhs
where lhs
gives the data values and rhs the corresponding groups.formula
.
By default the variables are taken from environment(formula)
.plotit
, if it does not exist then it's set to FALSE
.Desc
.
However DescWrd
takes some more specific arguments concerning the Word output (like font or fontsize), which can make it necessary to call the function directly.Desc
# Output into word document ---------------------------------------------------------
# Windows-specific example
wrd <- GetNewWrd(header=TRUE) # create a new word instance and insert title and contents
# let's have a subset
d.sub <- d.pizza[,c("driver","date","operator","price","wrongpizza")]
# do just the univariate analysis
Desc(d.sub, wrd=wrd)
# do a full report
Desc(d.sub, wrd=wrd, colpairs=TRUE)
# do just bivariate analysis
Desc( d.sub, univar=FALSE, colpairs=TRUE, wrd=wrd)
# selected bivariate analysis into word document
Desc(week ~ driver, data=d.pizza, wrd=wrd)
Desc(price ~ operator, data=d.pizza, digits=c(2,2,2,2,0,3,0,0), wrd=wrd )
Desc(driver ~ operator, data=d.pizza, wrd=wrd)
Desc(price ~ operator + driver + wrongpizza, data=d.pizza
, digits=c(2,2,2,2,0,3,0,0), wrd=wrd)
Desc(price ~ delivery_min, data=d.pizza, wrd=wrd )
# internal functions (not meant to be used by the enduser):
Desc.factor(d.pizza$driver, ord="n" ) # ordered by name
Desc.factor(d.pizza$driver, ord="l" ) # ordered by level
Desc.logical(d.pizza$wrongpizza)
Desc.integer(d.pizza$weekday, maxlevels=NA)
Desc.integer(d.pizza$weekday, maxlevels=3)
Desc.numeric(d.pizza$count, highlow=FALSE)
Desc.numeric(d.pizza$count, highlow=TRUE)
DescNumFact( x=d.pizza$delivery_min, grp=d.pizza$operator )
DescFactFact( x=d.pizza$driver, grp=d.pizza$operator)
DescNumNum( x=d.pizza$delivery_min, y=d.pizza$price )
Run the code above in your browser using DataLab