Skip to contents

Take in the results of an SSM analysis and return an HTML table with the desired formatting.

Usage

ssm_table(.ssm_object, caption = NULL, xy = TRUE, render = TRUE)

Arguments

.ssm_object

The output of ssm_profiles() or ssm_measures()

caption

A string to be displayed above the table (default = NULL).

xy

A logical indicating whether the x-value and y-value parameters should be included in the table as columns (default = TRUE).

render

A logical indicating whether the table should be displayed in the RStudio viewer or web browser (default = TRUE).

Value

A tibble containing the information for the HTML table. As a side-effect, may also output the HTML table to the web viewer.

See also

Other ssm functions: ssm_analyze(), ssm_append(), ssm_parameters(), ssm_plot(), ssm_score()

Other table functions: html_render(), ssm_append()

Examples

# \donttest{
# Load example data
data("jz2017")

# Create table of profile results
res <- ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(),
  measures = c(NARPD, ASPD)
)
ssm_table(res)
#> <table class='gmisc_table' style='border-collapse: collapse; margin-top: 1em; margin-bottom: 1em;' >
#> <thead>
#> <tr><td colspan='7' style='text-align: left;'>
#> Correlation-based Structural Summary Statistics with 95% CIs</td></tr>
#> <tr>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Profile</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Elevation</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>X-Value</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Y-Value</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Amplitude</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Displacement</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Fit</th>
#> </tr>
#> </thead>
#> <tbody>
#> <tr>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>NARPD</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>0.20 (0.17, 0.24)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>-0.06 (-0.09, -0.03)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>0.18 (0.14, 0.21)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>0.19 (0.15, 0.22)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>109.0 (99.4, 118.4)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; text-align: left;'>0.957</td>
#> </tr>
#> <tr>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>ASPD</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.12 (0.09, 0.16)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>-0.10 (-0.13, -0.06)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.20 (0.17, 0.24)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.23 (0.19, 0.26)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>115.9 (107.4, 124.5)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.964</td>
#> </tr>
#> </tbody>
#> </table>
#> # A tibble: 2 × 7
#>   Profile Elevation         `X-Value`     `Y-Value` Amplitude Displacement Fit  
#>   <chr>   <chr>             <chr>         <chr>     <chr>     <chr>        <chr>
#> 1 NARPD   0.20 (0.17, 0.24) -0.06 (-0.09… 0.18 (0.… 0.19 (0.… 109.0 (99.4… 0.957
#> 2 ASPD    0.12 (0.09, 0.16) -0.10 (-0.13… 0.20 (0.… 0.23 (0.… 115.9 (107.… 0.964

# Create table of contrast results
res <- ssm_analyze(jz2017,
  scales = PA:NO, angles = octants(),
  measures = c(NARPD, ASPD), contrast = "test"
)
ssm_table(res)
#> <table class='gmisc_table' style='border-collapse: collapse; margin-top: 1em; margin-bottom: 1em;' >
#> <thead>
#> <tr><td colspan='7' style='text-align: left;'>
#> Correlation-based Structural Summary Statistic Contrasts with 95% CIs</td></tr>
#> <tr>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>Contrast</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>&Delta; Elevation</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>&Delta; X-Value</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>&Delta; Y-Value</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>&Delta; Amplitude</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>&Delta; Displacement</th>
#> <th style='font-weight: 900; border-bottom: 1px solid grey; border-top: 2px solid grey; text-align: left;'>&Delta; Fit</th>
#> </tr>
#> </thead>
#> <tbody>
#> <tr>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>ASPD - NARPD</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>-0.08 (-0.12, -0.04)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>-0.04 (-0.07, 0.00)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.02 (-0.01, 0.06)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.04 (-0.00, 0.08)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>7.0 (-2.9, 17.1)</td>
#> <td style='padding-right: 1em; min-width: 3em; white-space: nowrap; border-bottom: 2px solid grey; text-align: left;'>0.007</td>
#> </tr>
#> </tbody>
#> </table>
#> # A tibble: 1 × 7
#>   Contrast     `&Delta; Elevation`  `&Delta; X-Value`   `&Delta; Y-Value` 
#>   <chr>        <chr>                <chr>               <chr>             
#> 1 ASPD - NARPD -0.08 (-0.12, -0.04) -0.04 (-0.07, 0.00) 0.02 (-0.01, 0.06)
#> # ℹ 3 more variables: `&Delta; Amplitude` <chr>, `&Delta; Displacement` <chr>,
#> #   `&Delta; Fit` <chr>
# }