Description Usage Arguments Details Value Author(s) See Also Examples
Various auxiliary convenience functions, mostly for XLunivariate
.
Functions calculating simple statistics and returning the output in a formatted manner, making it easier for XLunivariate
to embed them in spreadsheet cells.
1 2 3 4 5 6 7 8 9 10 11 |
x |
vector (usually numeric, but can be logical) on which statistics are to be calculated |
digits |
numeric: how many digits to round the output to? |
sep |
character: separating character for range- type functions. |
na.rm |
logical: should missing values be removed? (default |
... |
this is ignored by the functions, but enables the "mixing and matching" of extra parameters between functions called by |
quantmeth |
numeric: for functions calling |
This is a small collection of useful utilities called by XLunivariate
. They return 1-2 summary statistics, in a format that will not require additional formatting and formula-manipulation in Excel.
For example, roundmedian
returns the median rounded to the specified number of digits, while iqrString
returns the 1st and 3rd quartiles, separated by at least one dash (default 3 dashes). XLunivariate
can combine these functions' output to produce the formatted summary "median (Q1---Q3)"
often used in research articles.
In particular, emptee
returns an empty string, enabling the use of XLunivariate
to produce only a single summary statistic per cell rather than a pair.
The summary statistic(s), in the format specified via the arguments.
Assaf P. Oron <assaf.oron.at.seattlechildrens.org>
XLunivariate
which is the main function calling these utilities.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | book2<-XLwriteOpen("chick2.xls")
## Plain-vanilla
XLunivariate(book2,"weightByDiet",ChickWeight$weight,ChickWeight$Diet,
title="Mean Weights by Diet",rowTitle="Diet")
## Replace mean/SD with median/range, put results beside previous
XLunivariate(book2,"weightByDiet",ChickWeight$weight,ChickWeight$Diet,
title="Median Weights by Diet",rowTitle="Diet",col1=8,
fun1=list(fun=roundmedian,name="Median"),fun2=list(fun=rangeString,name="range"))
### You can also do only one statistic... by "killing" one of the functions
XLunivariate(book2,"weightByAge",ChickWeight$weight,ChickWeight$Time,
title="Mean Weights by Age",rowTitle="Age (Days)",seps=rep("",3),
fun2=list(fun=emptee,name=""))
cat("Look for",paste(getwd(),"chick2.xls",sep='/'),"to see the results!\n")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.