Skip to content

Commit

Permalink
Merge pull request #46 from JuliaStats/db/Arraycall
Browse files Browse the repository at this point in the history
Fix warnings from `Pkg.test` on v0.6.1
  • Loading branch information
kleinschmidt authored Dec 4, 2017
2 parents d7f285a + e76ca99 commit ec5ed7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/modelmatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ function droprandomeffects(trms::Terms)
if !any(retrms) # return trms unchanged
trms
elseif all(retrms) && !trms.response # return an empty Terms object
Terms(Any[],Any[],Array(Bool, (0,0)),Array(Bool, (0,0)), Int[], false, trms.intercept)
Terms(Any[],Any[],Array{Bool}((0,0)),Array{Bool}((0,0)), Int[], false, trms.intercept)
else
# the rows of `trms.factors` correspond to `eterms`, the columns to `terms`
# After dropping random-effects terms we drop any eterms whose rows are all false
ckeep = !retrms # columns to retain
ckeep = .!retrms # columns to retain
facs = trms.factors[:, ckeep]
rkeep = vec(sum(facs, 2) .> 0)
Terms(trms.terms[ckeep], trms.eterms[rkeep], facs[rkeep, :],
Expand Down
2 changes: 1 addition & 1 deletion test/modelmatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ mf = ModelFrame(@formula(y ~ 1 + (1 | x)), df)

mf = ModelFrame(@formula(y ~ 0 + (1 | x)), df)
@test_throws ErrorException ModelMatrix(mf)
@test coefnames(mf) == Vector{Compat.UTF8String}()
@test coefnames(mf) == Vector{String}()


# Ensure X is not a view on df column
Expand Down

0 comments on commit ec5ed7b

Please sign in to comment.