r2lUniv.r2lBasicClasses {r2lUniv}R Documentation

Methods for r2l basic classes

Description

Method used by r2lUniv for r2lUniv basic classes.

On r2lUniv basic classes, r2lUniv makes some analyses according to the variable class, then exports the LaTeX code.

Usage

r2lUniv.nominal(data, fileOutput = "", varName = NA, varNumber = NA, dirGraph = "", graphName = "V",...)
r2lUniv.ordinal(data, fileOutput = "", varName = NA, varNumber = NA, dirGraph = "", graphName = "V",...)
r2lUniv.discrete(data, fileOutput = "", varName = NA, varNumber = NA, dirGraph = "", graphName = "V",...)
r2lUniv.continuous(data, fileOutput = "", varName = NA, varNumber = NA, dirGraph = "", graphName = "V",...)

Arguments

data vector; to print
fileOutput character; name of the output file to save the LaTeX code. If empty, code is printed on screen.
varName character, single; title of the LaTeX summary. For no title, use NA instead of "".
varNumber numeric, single; number to be printed before the title. For no number, use NA instead of "".
dirGraph character; Directory used to save the graphs generated by the analyses.
graphName character, single; Prefix of the graphs' names. The full names of the graphs will be graphName with a postfix in ("-boxplot.eps", "-barplot.eps", "-hist.eps")
... For S3 compatibility only

Details

On r2lUniv basic classes, r2lUniv makes some analyses according to the variable class, then exports the LaTeX code.

The analyses depend on the r2lUniv basic classes:

  1. Nominal: Frequency. Graph: barplot.
  2. Ordinal: Frequency and quartile. Graph: barplot.
  3. Discrete: Frequency, mean, variance, quartile. Graph: boxplot and barplot.
  4. Continuous: Mean, variance, quartile. Graph: boxplot and histogram.

Then the LaTeX summary is exported, either on the screen, or in a file specified by fileOutput.

Value

r2lUniv either prints LaTeX code on the screen or saves it in a file. It also generates several encapsuled postsript graphs (.eps), optionally in a directory.

R to LaTeX, Bivariate Analyses

r2lBiv (R to LaTeX, Bivariate Analyses) is under contruction. Any help will be welcomed!

Author(s)

Christophe Genolini
INSERM U669, PSIGIAM
Paris Sud Innovation Group in Adolescent Mental Health
christophe.genolini@free.fr

Jean-Marc Chamot (English correction)
UFR STAPS, Universite Paris X - Nanterre

References

LaTeX web site http://www.latex-project.org/

See Also

Sweave, latex, r2lConcepts, r2lUniv.data.frame, r2lUniv.r2lBasicClasses, r2lUniv.Rclasses

Examples

 # # # # # # # # # # # # # # # # # # #
#   R to LaTeX, Univariate Analyses   #
 #             Examples              #
  #        r2l Basic classes        #
   # # # # # # # # # # # # # # # # #

########################
###### Step 1: Load the data

data(Vnominal)
data(Vordinal)
data(Vdiscrete)
data(Vcontinuous)

########################
###### Step 4: Run

### The following code will create some files.
### We advise you to first move in directory "r2lUnivExample"
dir.create("r2lUnivExample")
setwd("r2lUnivExample")
dir.create("graph")

r2lUniv(Vnominal,"nominal.tex")
r2lUniv(Vordinal,"ordinal.tex",varName="Peep",graphName="O")
r2lUniv(Vdiscrete,"discrete.tex",varNumber="3",graphName="D",dirGraph="graph")
r2lUniv(Vcontinuous,"continuous.tex",varName="CheatScore",varNumber="4",graphName="C")

### Creates the main document.
r2lGenerateLatexMain(c("nominal.tex","ordinal.tex","discrete.tex","continuous.tex"))

### Everything is ready, you can now run LaTeX on the file "main.tex"
setwd("..")

[Package r2lUniv version 0.9 Index]