daroczig / fbRads

Analyze and manage Facebook ads from R using this client library to access their Marketing APIs
GNU Affero General Public License v3.0
151 stars 57 forks source link

attempt to set an attribute on NULL #109

Closed simran-k closed 5 years ago

simran-k commented 5 years ago
Error in data.table::rbindlist(.data, ...) : 
  attempt to set an attribute on NULL

I am getting this error at:

FBInsightsExpanded <<- list.stack(list.select(FBInsightsExpanded, website_purchase_roas = website_purchase_roas$action_link_click_destination));
  print(FBInsightsExpanded)

This is what the DF looks like. I am guessing I need to replace NULLs with NA's. But not able to get a fix for it so far

 website_purchase_roas  date_stop
1    0.673001 offsite_conversion.fb_pixel_purchase, 6.506892 2018-10-11
2    1.369035 offsite_conversion.fb_pixel_purchase, 0.594109 2018-10-11
3    2.084238                                           NULL 2018-10-11
4     1.31209                                           NULL 2018-10-11
5    2.337662                                           NULL 2018-10-11
6    0.996678                                           NULL 2018-10-11
7    1.936385 offsite_conversion.fb_pixel_purchase, 1.482508 2018-10-11
8    2.777778                                           NULL 2018-10-11
9           0                                           NULL 2018-10-11
10   1.994885                                           NULL 2018-10-11
11   2.402023                                           NULL 2018-10-11
12   4.635056 offsite_conversion.fb_pixel_purchase, 5.222421 2018-10-11
13          0                                           NULL 2018-10-11
14   1.990291                                           NULL 2018-10-11
15   6.557377                                           NULL 2018-10-11
16   3.703704                                           NULL 2018-10-11
17   3.038936                                           NULL 2018-10-11
daroczig commented 5 years ago

Sorry to close the ticket, but this ticket/problem is not specific to the fbRads package, but you have a question related to data transformations that I cannot support. I'd suggest checking other functions of the rlist package, or even an rapply could do the trick.