Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Created June 26, 2014 14:53
Show Gist options
  • Save randyzwitch/397ff5815d220a6db809 to your computer and use it in GitHub Desktop.
Save randyzwitch/397ff5815d220a6db809 to your computer and use it in GitHub Desktop.
Duplicate column names in data frame
#Loop over df and accumulate results
#Adding row.names = NULL fixes error message
parsed_df <- data.frame()
for(i in 1:nrow(df)){
temp <- cbind(df[i,],breakdown_list[[i]], row.names = NULL)
parsed_df <- rbind(parsed_df, temp)
}
names(parsed_df)
> names(parsed_df)
[1] "name" "year" "month" "day" "hour" "minute" "breakdownTotal"
[8] "name" "trend" "counts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment