tableVisual: Produce tables for the makeDataReport visualizations.

Description Usage Arguments See Also Examples

View source: R/tableVisual.R

Description

Produce a table of the distribution of a categorical (character, labelled, haven_labelled or factor) variable. Note that tableVisual is a visualFunction, compatible with the visualize and makeDataReport functions.

Usage

1
tableVisual(v, vnam, doEval = TRUE)

Arguments

v

The variable (vector) to be plotted.

vnam

The name of the variable.

doEval

If TRUE, the table itself is returned. Otherwise, the function returns a character string containing standalone R code for producing the table.

See Also

visualize, basicVisual, standardVisual

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
#Save a variable
myVar <- c("red", "blue", "red", "red", NA) 

#Plot a variable
tableVisual(myVar, "MyVar")

#Produce code for plotting a variable
tableVisual(myVar, "MyVar", doEval = FALSE)

## End(Not run)

ekstroem/cleanR documentation built on Jan. 31, 2022, 8:58 a.m.