Description Usage Arguments Details Value Classical usage Author References See Also Examples
r2htmlBiv (or r2hb in short) performs some bivariate analyses, then generates code to be
included in a HTML document in order to print out the analyses on a Web page.
1 2 |
formula |
|
fileOut |
|
textBefore |
|
textAfter |
|
graphDir |
|
graphName |
|
type |
|
displayStyle |
The first one is compact, it displays all the results on two lines. If the
number of modalities of The switch (compact/expanded) is done automatically by If |
limDiscreteY |
The default value for |
limDiscreteX |
|
r2hb performs some basic analyses, then generates
code to be included in a HTML document in order to print out the analyses in a
Web page.
r2hb performs the analyses automatically according to the
data class. It considers 5 classes: nominal with 2 modalities,
nominal with 3 modalities or more, ordered, discrete and
continuous (see the description of limDiscreteY for details on
discrete and continuous).
The analysis of the variable depends on the class of Y and
X wich gives 25 possible combinations. We will not give a
description here, all of them are presented in the pdf file /library/r2lh/doc/r2lhOutput.pdf.
They can be divided in two categories. First (on the top of the tabular) are descriptive analyses:
table: absolute and relative frequency.
summary: mainly whenY is continuous and X has
few modalities.
graphical representation: barplot or boxplot for each
modalities of X, mosaic plot, scatter plot, density lines
according to the type of the variable.
On the second part of the tabular are all the informations related to
a potential link between Y and X.
test: khi2, Fisher exact test, Student's T, ANOVA, Wilcoxon, Kruskal & Wallis,
Spearman correlation, Pearson correlation, Odds Ratio and Relative
Risk, depending on the classes of Y and X. Note that as
many tests as possible are run. For example, if Y is nominal
and Xis ordered, X can be considered as
a factor (khi2 and Fisher exact test) but also as a discrete variable (Wilcoxon).
graphical diagnostic: the test presented might not be all valid. Some graphical diagnostic (check for normality) are presented to let the user decide which test is more relevant.
The wide display gives :
1 2 3 4 5 | +---+---+---+
| 1 | 2 | 3 |
+---+-+-+---+
| 4 | 5 |
+-----+-----+
|
The long display :
1 2 3 4 5 6 7 | +-------+
| 1 |
+---+---+
| 2 | 3 |
+---+---+
| 4 | 5 |
+---+---+
|
If X is a data.frame, r2hb runs the analyses on
every column.
See /library/r2lh/doc/r2lhOutput.pdf for display detail.
r2hb generates HTML code and either prints it on the screen, or saves it in a
file. It also generates several graphs, optionally
in a different directory.
The use of r2hb goes through the following steps:
| Step 1. | Load the data (usually, a data.frame). |
| Step 2. | Optionally, set some variables as ordered. |
| Step 3. | Run r2hb(Y~dataFrame,"fileOut.html"). |
See examples of application.
Christophe Genolini
christophe.genolini@free.fr
PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health
INSERM U669 / Maison de Solenn / Paris
Bernard Desgraupes
bernard.desgraupes@u-paris10.fr
University of Paris Ouest - Nanterre
HTML web site http://www.latex-project.org/
Data are available on line: http://christophe.genolini.free.fr/EPO/EPO2007-Fraude.php
r2hMainFile,
r2htmlUniv,
r2htmlUniv-package,
examCheating
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # # # # # # # # # # # # # # # # # # #
# R to HTML, Bivariate Analyses #
# Artificial examples #
# Single variable #
# # # # # # # # # # # # # # # # #
### Create some data
V1 <- factor(LETTERS[floor(runif(50,1,4))])
V2 <- rnorm(50,1,1)<0
V3 <- ordered(LETTERS[floor(runif(50,1,4))])
### Create a directory for the output
if(!file.exists("tmp/r2hbExample",recursive=TRUE)){dir.create("tmp/r2hbExample",recursive=TRUE)}else{}
setwd("tmp/r2hbExample")
### Execute r2hb
r2hb(V1~V2,fileOut="first.html",textBefore="<H2>Variables V1, V2, V3</H2>",graphName="Gr1",type="png")
r2hb(V2~V1,fileOut="second.html",graphName="Gr2",type="png")
r2hb(V3~V1,fileOut="third.html",textBefore="This is V3 vs. V1",graphDir="P",graphName="Gr3",type="png",displayStyle=2)
r2hMainFile(text="
<LU>
<LI><A HREF='first.html'>First example</A></LI>
<LI><A HREF='second.html'>Second example</A></LI>
<LI><A HREF='third.html'>Third example</A></LI>
</LU>
")
setwd("..")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.