Created
June 26, 2014 15:10
-
-
Save randyzwitch/97588898e5eccacd79dd to your computer and use it in GitHub Desktop.
Final parsing solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Separate breakdown list and original data frame into different objects | |
| df <- ex_df$report$data | |
| breakdown_list <- df$breakdown | |
| df$breakdown <- NULL | |
| #Loop over df and accumulate results | |
| parsed_df <- data.frame() | |
| for(i in 1:nrow(df)){ | |
| right_df <- breakdown_list[[i]] | |
| right_df <- rename(right_df, replace=c("name" = report_raw$report$elements$id[2])) | |
| temp <- cbind(df[i,],right_df, row.names = NULL) | |
| parsed_df <- rbind(parsed_df, temp) | |
| } | |
| parsed_df <- rename(parsed_df, replace=c("counts" = report_raw$report$metrics$id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment