I'm using the package in R fbRads
to collect Facebook Ads data. However, when I transform it into a data frame, I get a list with the values, rather than the numeric value. How can I separate only this value?
library(fbRads)
library(tidyr)
library(jsonlite)
library(googlesheets)
library(stringr)
auth = fbad_init("", "", version='3.0')
Facebook = fb_insights(auth, time_increment="1", level="ad", fields =
toJSON(c("impressions", "date_start", "ad_name", "adset_name",
"campaign_name", "clicks", "spend", "inline_post_engagement",
"video_10_sec_watched_actions","video_avg_percent_watched_actions",
"video_p95_watched_actions", "actions", "link_click")))
Facebook = as.data.frame(do.call(rbind, Facebook))
data.frame(t(sapply(Facebook,c)))
I get this list of outputs in response. I need each of these to be a separate column in the default dataframe.