Skip to content

Commit

Permalink
Fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
iuliadmtru committed Jul 13, 2022
1 parent ab0908c commit 376e7a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/svydesign.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ check_strat: true
"""
struct svydesign
id
strata::Symbol
variables::DataFrame
nest::Bool
check_strat::Bool
Expand Down Expand Up @@ -78,6 +77,10 @@ function get_strata(data, strata::Symbol)
return data[!, String(strata)]
end

function get_strata(data, strata::Vector)
return strata
end

function get_strata(data, strata::Nothing)
return repeat([1], nrow(data))
end
Expand All @@ -102,7 +105,7 @@ function Base.show(io::IO, design::svydesign)
printstyled("\nid: "; bold = true)
print(design.id)
printstyled("\nstrata: "; bold = true)
print(design.variables.strata)
print_short(design.variables.strata)
printstyled("\nprobs: "; bold = true)
print_short(design.variables.probs)
printstyled("\nfpc: "; bold = true)
Expand Down

0 comments on commit 376e7a2

Please sign in to comment.