GlobalSearchRegression.jl
GlobalSearchRegression.jl copied to clipboard
ERROR: MethodError: Cannot `convert` an object of type Nothing to an object of type Int64
I'm reading in a .csv file with DelimitedFiles like this:
data = readdlm("clean_data.csv", ',', Int, header=true)
data[1]
is a 230×19 Array{Int64,2}
and data[2]
is a 1×19 Array{AbstractString,2}
. However, when I run
gsreg("y *", data)
I get the following error (even though my data doesn't have any Nothing types in it):
ERROR: MethodError: Cannot `convert` an object of type Nothing to an object of type Int64
Closest candidates are:
convert(::Type{T}, ::T) where T<:Number at number.jl:6
convert(::Type{T}, ::Number) where T<:Number at number.jl:7
convert(::Type{T}, ::Ptr) where T<:Integer at pointer.jl:23
...
Stacktrace:
[1] setindex!(::Dict{Symbol,Int64}, ::Nothing, ::Symbol) at .\dict.jl:380
[2] get_result_header(::Array{Symbol,1}, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Array{Any,1}, ::Bool) at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\utils.jl:90
[3] GlobalSearchRegression.GSRegResult(::Symbol, ::Array{Symbol,1}, ::Array{Float32,2}, ::Bool, ::Int64, ::Array{Any,1}, ::Bool, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Array{Any,1}, ::Type, ::Bool, ::GlobalSearchRegression.var"#1#2", ::Nothing) at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\gsreg_result.jl:58
[4] #gsreg#23 at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\core.jl:50 [inlined]
[5] (::GlobalSearchRegression.var"#kw##gsreg")(::NamedTuple{(:datanames, :intercept, :outsample, :criteria, :ttest, :vectoroperation, :modelavg, :residualtest, :time, :summary, :datatype, :orderresults, :onmessage, :parallel),Tuple{Array{Any,1},Bool,Int64,Array{Any,1},Bool,Bool,Bool,Nothing,Nothing,Nothing,DataType,Bool,GlobalSearchRegression.var"#1#2",Nothing}}, ::typeof(gsreg), ::Symbol, ::Array{Symbol,1}, ::Array{Float32,2}) at .\none:0
[6] #gsreg#22(::Bool, ::Int64, ::Array{Any,1}, ::Bool, ::String, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Bool, ::GlobalSearchRegression.var"#1#2", ::Nothing, ::typeof(gsreg), ::Array{Symbol,1}, ::Array{Int64,2}, ::Array{Any,1}) at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\interface.jl:292
[7] #gsreg at .\none:0 [inlined]
[8] #gsreg#21(::Array{AbstractString,2}, ::Bool, ::Int64, ::Array{Any,1}, ::Bool, ::String, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Bool, ::GlobalSearchRegression.var"#1#2", ::Nothing, ::typeof(gsreg), ::Array{Symbol,1}, ::Tuple{Array{Int64,2},Array{AbstractString,2}}) at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\interface.jl:173
[9] (::GlobalSearchRegression.var"#kw##gsreg")(::NamedTuple{(:datanames, :intercept, :outsample, :criteria, :ttest, :method, :vectoroperation, :modelavg, :residualtest, :time, :summary, :resultscsv, :csv, :orderresults, :onmessage, :parallel),Tuple{Array{AbstractString,2},Bool,Int64,Array{Any,1},Bool,String,Bool,Bool,Nothing,Nothing,Nothing,Nothing,Nothing,Bool,GlobalSearchRegression.var"#1#2",Nothing}}, ::typeof(gsreg), ::Array{Symbol,1}, ::Tuple{Array{Int64,2},Array{AbstractString,2}}) at .\none:0
[10] #gsreg#20(::Nothing, ::Bool, ::Int64, ::Array{Any,1}, ::Bool, ::String, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Bool, ::GlobalSearchRegression.var"#1#2", ::Nothing, ::typeof(gsreg), ::Array{String,1}, ::Tuple{Array{Int64,2},Array{AbstractString,2}}) at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\interface.jl:117
[11] (::GlobalSearchRegression.var"#kw##gsreg")(::NamedTuple{(:datanames, :intercept, :outsample, :criteria, :ttest, :method, :vectoroperation, :modelavg, :residualtest, :time, :summary, :resultscsv, :csv, :orderresults, :onmessage, :parallel),Tuple{Nothing,Bool,Int64,Array{Any,1},Bool,String,Bool,Bool,Nothing,Nothing,Nothing,Nothing,Nothing,Bool,GlobalSearchRegression.var"#1#2",Nothing}}, ::typeof(gsreg), ::Array{String,1}, ::Tuple{Array{Int64,2},Array{AbstractString,2}}) at .\none:0
[12] gsreg(::String, ::Tuple{Array{Int64,2},Array{AbstractString,2}}) at C:\Users\mthel\.julia\packages\GlobalSearchRegression\afyOH\src\interface.jl:67
[13] top-level scope at REPL[177]:1