save_weights: Save weights as .rds or .dta file

View source: R/save_weights.R

save_weightsR Documentation

Save weights as .rds or .dta file

Description

This will save all variables with names containing 'weight_'

Usage

save_weights(data, format = c("rds", "dta"),
  file_name = paste0("weights.", format), include_reps = TRUE)

Arguments

data

the data.frame to take the weights from.

format

save as .rds file (R) or .dta file (Stata).

file_name

the path to where the file should be saved.

include_reps

logical. Should replicate weights by saved if found?

Value

a .dta or .rds file, depending on format.


jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.