Transpose of an array of Strings

I have found that one can use the function ‘permutedims’ to accomplish the task. I do not know why one could not simply overload the transpose function (or the apostrophy operator) via dispatch? I assume that transpose is a more efficient version of permutedims that is optimized for Numbers.

In the end, here is some code I wrote related to the question asked. All is solved, although there is probably a more elegant way to accomplish this. I appreciate all the help.

prob_ode = ODEProblem(households!,u0,tspan,params);
sol_ode = solve(prob_ode, Tsit5());
df_ode = DataFrame(sol_ode(t)')
df_ode[!,:t] = t;

# Extract subsets of DataFrame
nb_save = 7
df_S = df_ode[!, 0*nb_houses+1 : 0*nb_houses+nb_save];
df_I = df_ode[!, 1*nb_houses+1 : 1*nb_houses+nb_save];
df_R = df_ode[!, 2*nb_houses+1 : 2*nb_houses+nb_save];
df_S[!,:t] = df_ode[!,:t];
df_I[!,:t] = df_ode[!,:t];
df_R[!,:t] = df_ode[!,:t];

nb_kept = 4;

# Put each state in its own database
function plotDF(dfr, state)
	labels=[];
	for i in 1:nb_kept push!(labels, "S"*repr(i) ) end
	@df dfr plot(:t,
    	cols([1:nb_kept]),
		label=permutedims(labels),
    	xlabel="Time",
    	ylabel="Number Susceptibles")
end

plotDF(df_S, "S")
plotDF(df_I, "I")
plotDF(df_R, "R")
8 Likes