CSV.read() deprecated keyword argument

In Hayden Klok’s sample code, there’s a deprecated argument for CSV.read().

# from https://github.com/h-Klok/StatsWithJuliaBook/blob/master/1_chapter/usingR.jl#L3-L5
using CSV, DataFrames, RCall
data1 = CSV.read("machine1.csv", header=false, allowmissing=:none)[:,1]

Even though the commands can be run, the system gives a few warnings.

 Info: Precompiling RCall [6f49c342-dc21-5d91-9882-a32aef131414]
┌ Warning: `allowmissing` is a deprecated keyword argument
└ @ CSV ~/.julia/packages/CSV/MKiwM/src/CSV.jl:157

I tried searching Julia Data’s doc page and its GitHub project, but there’s little said above this deprecated argument.

What can be done to update the syntax?

2 Likes

I think you don’t need it anymore. What does it generate for a csv column with no missing values?

Yeah, allowmissing isn’t needed anymore. CSV.jl can now “perfectly type” a column when parsing a file and allowmissing was just an argument from before when you wanted to specify what should happen when CSV.jl “guessed wrong” at the type of a column.

So the short answer: take out that keyword argument.

2 Likes

Excuse me for late response. I was helping others to set up Staticman, a free and static commenting system on (personal) GitHub/GitLab pages.

Normal output apart from warning messages:

┌ Warning: `allowmissing` is a deprecated keyword argument
└ @ CSV ~/.julia/packages/CSV/MKiwM/src/CSV.jl:157
┌ Warning: `allowmissing` is a deprecated keyword argument
└ @ CSV ~/.julia/packages/CSV/MKiwM/src/CSV.jl:157
┌ Warning: `allowmissing` is a deprecated keyword argument
└ @ CSV ~/.julia/packages/CSV/MKiwM/src/CSV.jl:157
R ANOVA f-value: 10.516968568709089
R ANOVA p-value: 0.00014236168817139574

The machine1.csv actually refers to data/machine1.csv in the linked GitHub repo. This CSV file has no missing values.