Skip to contents

Export summary stat as an excel file

Usage

srv_prop_stats_crossing_wide_xlsx(
  data,
  file = NULL,
  wb = NULL,
  sheet_name = "Sheet 1",
  startCol = 1,
  startRow = 1
)

Arguments

data

Dataframe. Result from srv_prop_stats_crossing_wide().

file

File to write report to.

wb

Workbook. A Workbook object containing a worksheet.

sheet_name

Character. The name of the worksheet to write to.

startCol

Integer. A vector specifying the starting column to write to.

startRow

Integer. A vector specifying the starting row to write to.

Value

Workbook object

Examples

library(dplyr)

data("ds_custom")

res_1 <-
srv_prop_stats_crossing_wide(
  ds_custom,
  grp_vars = s_hhincome,
  sbj_vars = c(starts_with("m1_wrap_ai"), starts_with("d_social_use_ind_")),
  na.rm = TRUE,
  wt = weight
)
#> 
#> ── Detecting Data Type ──
#> 
#> • SR Variables: 3
#> • MR Variables: 1
#> ! Found 1 column with missing or invalid labels: "weight".
#> ℹ Replacing these labels with {.code NA_character_}
#> ! Found 2 columns with missing or invalid labels: "weight" and "group".
#> ℹ Replacing these labels with {.code NA_character_}

srv_prop_stats_crossing_wide_xlsx(res_1)
#> A Workbook object.
#>  
#> Worksheets:
#>  Sheet 1: "Sheet 1"
#>  
#> 	Custom column widths (column: width)
#> 	  1: 19, 2: 80, 3: 62, 4: 24, 5: 22, 6: 32, 7: 33, 8: 22 
#>  
#> 
#>  
#>  Worksheet write order: 1
#>  Active Sheet 1: "Sheet 1" 
#> 	Position: 1
#> 
if (FALSE) { # \dontrun{
srv_prop_stats_crossing_wide_xlsx(res_1, "test.xlsx")
} # }