Skip to contents

Preview first n rows as tibble

Usage

# S3 method for class 'classified'
print(x, ...)

Arguments

x

output from classify()

...

additional arguments passed to printing method for a tibble. n is the number of rows to preview. Set n = NULL to disable the tibble preview and print the object as is (a matrix).

Examples

# Preview all output
classify(c("C80", "I20", "unvalid_code"), "elixhauser")
#> Classification based on: icd10
#> 
#> The printed data is of class: classified, matrix.
#> It has 3 row(s).
#> It is here previewed as a tibble
#> Use `print(x, n = NULL)` to print as is (or use `n` to specify the number of rows to preview)!
#> 
#> # A tibble: 3 × 31
#>   `congestive heart failure` `cardiac arrhythmias` `valvular disease`
#>   <lgl>                      <lgl>                 <lgl>             
#> 1 FALSE                      FALSE                 FALSE             
#> 2 FALSE                      FALSE                 FALSE             
#> 3 FALSE                      FALSE                 FALSE             
#> # ℹ 28 more variables: `pulmonary circulation disorder` <lgl>,
#> #   `peripheral vascular disorder` <lgl>, `hypertension uncomplicated` <lgl>,
#> #   `hypertension complicated` <lgl>, paralysis <lgl>,
#> #   `other neurological disorders` <lgl>, `chronic pulmonary disease` <lgl>,
#> #   `diabetes uncomplicated` <lgl>, `diabetes complicated` <lgl>,
#> #   hypothyroidism <lgl>, `renal failure` <lgl>, `liver disease` <lgl>,
#> #   `peptic ulcer disease` <lgl>, `AIDS/HIV` <lgl>, lymphoma <lgl>, …

# Preview only the first row
print(classify(c("C80", "I20", "unvalid_code"), "elixhauser"), n = 1)
#> Classification based on: icd10
#> 
#> The printed data is of class: classified, matrix.
#> It has 3 row(s).
#> It is here previewed as a tibble
#> Use `print(x, n = NULL)` to print as is (or use `n` to specify the number of rows to preview)!
#> 
#> # A tibble: 1 × 31
#>   `congestive heart failure` `cardiac arrhythmias` `valvular disease`
#>   <lgl>                      <lgl>                 <lgl>             
#> 1 FALSE                      FALSE                 FALSE             
#> # ℹ 28 more variables: `pulmonary circulation disorder` <lgl>,
#> #   `peripheral vascular disorder` <lgl>, `hypertension uncomplicated` <lgl>,
#> #   `hypertension complicated` <lgl>, paralysis <lgl>,
#> #   `other neurological disorders` <lgl>, `chronic pulmonary disease` <lgl>,
#> #   `diabetes uncomplicated` <lgl>, `diabetes complicated` <lgl>,
#> #   hypothyroidism <lgl>, `renal failure` <lgl>, `liver disease` <lgl>,
#> #   `peptic ulcer disease` <lgl>, `AIDS/HIV` <lgl>, lymphoma <lgl>, …

# Print object as is (matrix)
print(classify(c("C80", "I20", "unvalid_code"), "elixhauser"), n = NULL)
#> Classification based on: icd10
#> 
#> The printed data is of class: classified, matrix.
#> It has 3 row(s).
#> It is here previewed as a tibble
#> Use `print(x, n = NULL)` to print as is (or use `n` to specify the number of rows to preview)!
#> 
#> # A tibble: 3 × 31
#>   `congestive heart failure` `cardiac arrhythmias` `valvular disease`
#>   <lgl>                      <lgl>                 <lgl>             
#> 1 FALSE                      FALSE                 FALSE             
#> 2 FALSE                      FALSE                 FALSE             
#> 3 FALSE                      FALSE                 FALSE             
#> # ℹ 28 more variables: `pulmonary circulation disorder` <lgl>,
#> #   `peripheral vascular disorder` <lgl>, `hypertension uncomplicated` <lgl>,
#> #   `hypertension complicated` <lgl>, paralysis <lgl>,
#> #   `other neurological disorders` <lgl>, `chronic pulmonary disease` <lgl>,
#> #   `diabetes uncomplicated` <lgl>, `diabetes complicated` <lgl>,
#> #   hypothyroidism <lgl>, `renal failure` <lgl>, `liver disease` <lgl>,
#> #   `peptic ulcer disease` <lgl>, `AIDS/HIV` <lgl>, lymphoma <lgl>, …