我有一个只有一行但只有95列的数据框。每列的值可以是列表或列表列表。大多数列表都有单值整数。我希望数据框包含整数值而不是列表元素。如果列表具有多个值,我希望分配新列并进行适当命名。
我该如何解决这个问题?我添加了dput对象以供参考。
structure(list(post_stories = structure(list(values = structure(list(
value = 123L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_storytellers = structure(list(values = structure(list(
value = 122L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_stories_by_action_type = structure(list(values = structure(list(
value = structure(list(share = 2L, like = 121L), .Names = c("share",
"like"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_storytellers_by_action_type = structure(list(values = structure(list(
value = structure(list(share = 2L, like = 121L), .Names = c("share",
"like"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_story_adds = structure(list(values = structure(list(
value = 123L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_story_adds_unique = structure(list(values = structure(list(
value = 122L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_story_adds_by_action_type = structure(list(values = structure(list(
value = structure(list(like = 121L, share = 2L), .Names = c("like",
"share"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_story_adds_by_action_type_unique = structure(list(values = structure(list(
value = structure(list(like = 122L, share = 2L), .Names = c("like",
"share"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_30s = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_30s_autoplayed = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_30s_clicked_to_play = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_30s_organic = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_30s_paid = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_30s_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_impressions = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_impressions_unique = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_consumptions_unique = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_consumptions = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_consumptions_by_type_unique = structure(list(
values = structure(list(value = structure(list(`video play` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), `other clicks` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), `photo view` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), `link clicks` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = c("video play",
"other clicks", "photo view", "link clicks"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_consumptions_by_type = structure(list(values = structure(list(
value = structure(list(`video play` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), `other clicks` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), `photo view` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), `link clicks` = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = c("video play",
"other clicks", "photo view", "link clicks"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_action_by_type_unique = structure(list(values = structure(list(
value = structure(list(like = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), comment = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), share = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = c("like", "comment",
"share"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_interests_action_by_type = structure(list(values = structure(list(
value = structure(list(like = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), comment = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame"), share = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = c("like", "comment",
"share"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions = structure(list(values = structure(list(
value = 4248L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_unique = structure(list(values = structure(list(
value = 3642L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_paid = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_paid_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_fan = structure(list(values = structure(list(
value = 4108L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_fan_unique = structure(list(values = structure(list(
value = 3527L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_fan_paid = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_fan_paid_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_organic = structure(list(values = structure(list(
value = 4171L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_organic_unique = structure(list(values = structure(list(
value = 3578L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_viral = structure(list(values = structure(list(
value = 77L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_viral_unique = structure(list(values = structure(list(
value = 74L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_by_story_type = structure(list(values = structure(list(
value = structure(list(other = 77L), .Names = "other", class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_by_story_type_unique = structure(list(values = structure(list(
value = structure(list(other = 74L), .Names = "other", class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_by_paid_non_paid = structure(list(values = structure(list(
value = structure(list(total = 4248L, unpaid = 4248L,
paid = 0L), .Names = c("total", "unpaid", "paid"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_impressions_by_paid_non_paid_unique = structure(list(
values = structure(list(value = structure(list(total = 3642L,
unpaid = 3642L, paid = 0L), .Names = c("total", "unpaid",
"paid"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_consumptions = structure(list(values = structure(list(
value = 355L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_consumptions_unique = structure(list(values = structure(list(
value = 75L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_consumptions_by_type = structure(list(values = structure(list(
value = structure(list(`other clicks` = 283L, `photo view` = 72L), .Names = c("other clicks",
"photo view"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_consumptions_by_type_unique = structure(list(values = structure(list(
value = structure(list(`other clicks` = 29L, `photo view` = 69L), .Names = c("other clicks",
"photo view"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_engaged_users = structure(list(values = structure(list(
value = 186L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_negative_feedback = structure(list(values = structure(list(
value = 1L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_negative_feedback_unique = structure(list(values = structure(list(
value = 1L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_negative_feedback_by_type = structure(list(values = structure(list(
value = structure(list(hide_clicks = 1L), .Names = "hide_clicks", class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_negative_feedback_by_type_unique = structure(list(values = structure(list(
value = structure(list(hide_clicks = 1L), .Names = "hide_clicks", class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_engaged_fan = structure(list(values = structure(list(
value = 179L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_fan_reach = structure(list(values = structure(list(value = 3527L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_anger_total = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_by_type_total = structure(list(values = structure(list(
value = structure(list(like = 109L, love = 0L, wow = 3L,
haha = 9L, sorry = 0L, anger = 0L), .Names = c("like",
"love", "wow", "haha", "sorry", "anger"), class = "data.frame", row.names = 1L)), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_haha_total = structure(list(values = structure(list(
value = 9L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_like_total = structure(list(values = structure(list(
value = 109L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_love_total = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_sorry_total = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_reactions_wow_total = structure(list(values = structure(list(
value = 3L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_avg_time_watched = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_organic = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_organic_unique = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_paid = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_complete_views_paid_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_retention_graph = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_retention_graph_clicked_to_play = structure(list(
values = structure(list(value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_retention_graph_autoplayed = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_organic = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_organic_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_paid = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_views_paid = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_paid_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_length = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_views = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_autoplayed = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_clicked_to_play = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_views_10s = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s_unique = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s_autoplayed = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s_clicked_to_play = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s_organic = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s_paid = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_views_10s_paid = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_10s_sound_on = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_sound_on = structure(list(values = structure(list(
value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_view_time = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_view_time = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_view_time_organic = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_view_time_organic = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_view_time_paid = structure(list(values = structure(list(
value = c(0L, 0L, 0L), end_time = c("2017-03-10T08:00:00+0000",
"2017-03-11T08:00:00+0000", "2017-03-12T08:00:00+0000"
)), .Names = c("value", "end_time"), class = "data.frame", row.names = c(NA,
3L))), .Names = "values"), post_video_view_time_paid = structure(list(
values = structure(list(value = 0L), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_view_time_by_age_bucket_and_gender = structure(list(
values = structure(list(value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_view_time_by_region_id = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_views_by_distribution_type = structure(list(values = structure(list(
value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values"),
post_video_view_time_by_distribution_type = structure(list(
values = structure(list(value = structure(list(), .Names = character(0), row.names = c(NA,
-1L), class = "data.frame")), .Names = "value", class = "data.frame", row.names = 1L)), .Names = "values")), .Names = c("post_stories",
"post_storytellers", "post_stories_by_action_type", "post_storytellers_by_action_type",
"post_story_adds", "post_story_adds_unique", "post_story_adds_by_action_type",
"post_story_adds_by_action_type_unique", "post_video_complete_views_30s",
"post_video_complete_views_30s_autoplayed", "post_video_complete_views_30s_clicked_to_play",
"post_video_complete_views_30s_organic", "post_video_complete_views_30s_paid",
"post_video_complete_views_30s_unique", "post_interests_impressions",
"post_interests_impressions_unique", "post_interests_consumptions_unique",
"post_interests_consumptions", "post_interests_consumptions_by_type_unique",
"post_interests_consumptions_by_type", "post_interests_action_by_type_unique",
"post_interests_action_by_type", "post_impressions", "post_impressions_unique",
"post_impressions_paid", "post_impressions_paid_unique", "post_impressions_fan",
"post_impressions_fan_unique", "post_impressions_fan_paid", "post_impressions_fan_paid_unique",
"post_impressions_organic", "post_impressions_organic_unique",
"post_impressions_viral", "post_impressions_viral_unique", "post_impressions_by_story_type",
"post_impressions_by_story_type_unique", "post_impressions_by_paid_non_paid",
"post_impressions_by_paid_non_paid_unique", "post_consumptions",
"post_consumptions_unique", "post_consumptions_by_type", "post_consumptions_by_type_unique",
"post_engaged_users", "post_negative_feedback", "post_negative_feedback_unique",
"post_negative_feedback_by_type", "post_negative_feedback_by_type_unique",
"post_engaged_fan", "post_fan_reach", "post_reactions_anger_total",
"post_reactions_by_type_total", "post_reactions_haha_total",
"post_reactions_like_total", "post_reactions_love_total", "post_reactions_sorry_total",
"post_reactions_wow_total", "post_video_avg_time_watched", "post_video_complete_views_organic",
"post_video_complete_views_organic_unique", "post_video_complete_views_paid",
"post_video_complete_views_paid_unique", "post_video_retention_graph",
"post_video_retention_graph_clicked_to_play", "post_video_retention_graph_autoplayed",
"post_video_views_organic", "post_video_views_organic_unique",
"post_video_views_paid", "post_video_views_paid", "post_video_views_paid_unique",
"post_video_length", "post_video_views", "post_video_views",
"post_video_views_unique", "post_video_views_autoplayed", "post_video_views_clicked_to_play",
"post_video_views_10s", "post_video_views_10s", "post_video_views_10s_unique",
"post_video_views_10s_autoplayed", "post_video_views_10s_clicked_to_play",
"post_video_views_10s_organic", "post_video_views_10s_paid",
"post_video_views_10s_paid", "post_video_views_10s_sound_on",
"post_video_views_sound_on", "post_video_view_time", "post_video_view_time",
"post_video_view_time_organic", "post_video_view_time_organic",
"post_video_view_time_paid", "post_video_view_time_paid", "post_video_view_time_by_age_bucket_and_gender",
"post_video_view_time_by_region_id", "post_video_views_by_distribution_type",
"post_video_view_time_by_distribution_type"), row.names = "values", class = "data.frame")