Skip to content

Commit 13464bc

Browse files
committed
Fix more 0.6 depwarns
1 parent 19821b9 commit 13464bc

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/statsmodels/formula.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function allvars(ex::Expr)
8888
end
8989
allvars(f::Formula) = unique(vcat(allvars(f.rhs), allvars(f.lhs)))
9090
allvars(sym::Symbol) = [sym]
91-
allvars(v::Any) = Array(Symbol, 0)
91+
allvars(v::Any) = Vector{Symbol}(0)
9292

9393
# special operators in formulas
9494
const specials = Set([:+, :-, :*, :/, :&, :|, :^])
@@ -208,9 +208,9 @@ evt(a) = Any[a]
208208
function Terms(f::Formula)
209209
rhs = condense(distribute(dospecials(f.rhs)))
210210
tt = unique(getterms(rhs))
211-
tt = tt[!(tt .== 1)] # drop any explicit 1's
211+
tt = tt[(!).(tt .== 1)] # drop any explicit 1's
212212
noint = (tt .== 0) .| (tt .== -1) # should also handle :(-(expr,1))
213-
tt = tt[!noint]
213+
tt = tt[(!).(noint)]
214214
oo = Int[ord(t) for t in tt] # orders of interaction terms
215215
if !issorted(oo) # sort terms by increasing order
216216
pp = sortperm(oo)
@@ -232,7 +232,7 @@ end
232232

233233
## Default NA handler. Others can be added as keyword arguments
234234
function na_omit(df::DataFrame)
235-
cc = complete_cases(df)
235+
cc = completecases(df)
236236
df[cc,:], cc
237237
end
238238

@@ -415,7 +415,7 @@ function droprandomeffects(trms::Terms)
415415
if !any(retrms) # return trms unchanged
416416
trms
417417
elseif all(retrms) && !trms.response # return an empty Terms object
418-
Terms(Any[],Any[],Array(Bool, (0,0)),Array(Bool, (0,0)), Int[], false, trms.intercept)
418+
Terms(Any[],Any[],Matrix{Bool}(0,0),Matrix{Bool}(0,0), Int[], false, trms.intercept)
419419
else
420420
# the rows of `trms.factors` correspond to `eterms`, the columns to `terms`
421421
# After dropping random-effects terms we drop any eterms whose rows are all false

src/statsmodels/statsmodel.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ for (modeltype, dfmodeltype) in ((:StatisticalModel, DataFrameStatisticalModel),
5858
end
5959

6060
# Delegate functions from StatsBase that use our new types
61-
typealias DataFrameModels Union{DataFrameStatisticalModel, DataFrameRegressionModel}
61+
const DataFrameModels = Union{DataFrameStatisticalModel, DataFrameRegressionModel}
6262
@delegate DataFrameModels.model [StatsBase.coef, StatsBase.confint,
6363
StatsBase.deviance, StatsBase.nulldeviance,
6464
StatsBase.loglikelihood, StatsBase.nullloglikelihood,

test/formula.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ module TestFormula
383383
d[:x1m] = @data [5, 6, NA, 7]
384384
mf = ModelFrame(@formula(y ~ x1m), d)
385385
mm = ModelMatrix(mf)
386-
@test mm.m[:, 2] == d[complete_cases(d), :x1m]
386+
@test mm.m[:, 2] == d[completecases(d), :x1m]
387387
@test mm.m == ModelMatrix{sparsetype}(mf).m
388388

389389
## Same variable on left and right side

0 commit comments

Comments
 (0)