Use the order
command on the column names:
currentNames = c("416362","417510","402634","406503","417510","402634","402634","402634","402634","402634",
"406801","416631","407508","413513","406801","416362","416631","406603","407508","416631",
"406603","406531","402634","402634","402634","406503","413513","416631","416631","406531")
df = data.frame(matrix(nrow=3,ncol=length(currentNames)))
colnames(df) = currentNames
df[1:nrow(df),1:ncol(df)] = runif(nrow(df)*ncol(df))
df = df[,order(colnames(df),decreasing=F)]