I got the code to work but I did not get a plot. Instead, I got this:
Sending you the entire cell:
begin
countries = ["Italy", "Germany", "India", "United Kingdom"]
y = DataFrame() # empty dataframe
dates = names(df)[begin:end-4]
date_format = Dates.DateFormat("m/d/y")
x_axis = parse.(Date, dates, date_format) .+ Year(2000)
for country in countries
data_dfr = get_country(df,country);
data_dfr = DataFrame(data_dfr);
df_rows, df_cols = size(data_dfr);
data_dfl = stack(data_dfr, 5:df_cols);
y[!,Symbol("$country")] = data_dfl[!,:value]
end
rows,cols = size(y)
i = 1
n = rows
while i <= n
if prod(isa.(collect((y)[i,:]),Number))==0
delete!(y,i)
global x_axis = x_axis[1:end .!= i]
global n -= 1
end
global i += 1
end
gr(size=(900,600))
@df y plot(x_axis, cols(1:cols),
label = reshape(names(y),(1,length(names(y)))),
xlabel = "Time",
ylabel = "Total number of reported cases",
xticks = x_axis[1:7:end],
xrotation = 45,
marker = (:diamond,4),
line = (:line, "gray"),
legend = :topleft,
grid = false,
framestyle = :semi,
legendfontsize = 9,
tickfontsize = 9,
formatter = :plain
)
y.One_million = Array{Union{Missing,Float64},1}(missing,size(y,1));
y.One_million .= 10^6.0;
display(@df y plot!(x_axis, y[!,cols+1],
linestyle = :dot,
linewidth = 5,
color = :red,
label = names(y)[cols+1]))
y = select!(y, Not([:One_million]));
end