write_bg_long: Make proportions of a list of factorial variables, and write...

Description Usage Arguments Value Examples

View source: R/write_bg_long.R

Description

Make proportions of a list of factorial variables, and write it in excel all in one table

Usage

1
2
3
4
5
6
7
write_bg_long(
  x,
  ...,
  folder_name = getwd(),
  transpose = F,
  name = "n_of_variables.xlsx"
)

Arguments

x

a tbl() that contains the variables of interest, keyed by ID variable

...

list of variables names that would appear in output

folder_name

where would the output file will be saved (project's home by default).

transpose

should it be horizontal (FALSE by default).

name

name of xlsx output file.

Value

computet tbl with the proportions of the variables of interest (as well as saved files)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#example run
data=tribble(~ID,~car_size,~gender,
             "1","large","woman",
             "2","large","woman",
             "3","small","woman",
             "4","small","man",
             "5","small","man",
             "6","large","man",
             "7",NA,"man")

long <- data %>%
  write_bg_long(car_size,gender,folder_name = "R",transpose = F)

sarid-ins/saridr documentation built on Nov. 10, 2020, 9:07 p.m.