visualize.classcodes: Visualize classification scheme in web browser

Description Usage Arguments Value See Also Examples

View source: R/visualize.R

Description

Groups from a classcodes object are visualized by their regular expressions in the default web browser. The visualization does not give any details on group names, conditions or weights but might be useful both for understanding of a classification scheme in use, and during the creation and debugging of such.

Usage

1
2
## S3 method for class 'classcodes'
visualize(x, group = NULL, show = TRUE, ...)

Arguments

x

classcodes object or name of such object included in the package (see all_classcodes()).

group

names (as character vector) of groups to visualize (subset of rownames(x)). (All groups if NULL.)

show

should a visualization be shown in the default web browser. Set to FALSE to just retrieve a URL for later use.

...

Arguments passed on to set_classcodes

regex

name of column with regular expressions to use for classification. NULL (default) uses attr(obj, "regexpr")[1].

Value

URL to website with visualization (invisible)

See Also

Other classcodes: all_classcodes(), as.data.frame.classified(), classcodes, codebook(), print.classcodes(), print.classified(), set_classcodes(), summary.classcodes()

Examples

 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
28
29
30
# The default behavior is to open a visualization in the default web browser
## Not run: 

 # How is depression classified according to Elixhauser?
 visualize("elixhauser", "depression")

 # Compare the two diabetes groups according to Charlson
 visualize("charlson",
   c("diabetes without complication", "diabetes complication"))

 # Is this different from the "Royal College of Surgeons classification?
 # Yes, there is only one group for diabetes
 visualize("charlson",
   c("diabetes without complication", "diabetes complication"),
   regex = "rcs"
 )

 # Show all groups from Charlson
 visualize("charlson")

 # It is also possible to visualize an arbitrary regular expression
 # from a character string
 visualize("I2([12]|52)")

## End(Not run)

 # The URL is always returned (invisable) but the visual display can
 # also be omitted
url <- visualize("hip_ae", show = FALSE)
url

coder documentation built on Jan. 18, 2021, 5:07 p.m.