Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Duplicate Row Names #82

Open
laziob opened this issue Jan 29, 2018 · 7 comments
Open

Duplicate Row Names #82

laziob opened this issue Jan 29, 2018 · 7 comments
Assignees

Comments

@laziob
Copy link

laziob commented Jan 29, 2018

Im using the fbad_list_ad function to get the active ads of a list of adsets ids, but for some reason I get an error of duplicate rownames. This only happens when getting the ads of different adsets at the same time.

testads <- fbad_list_ad(id = c("23842658373830776","23842658373930776","23842697638530776"), statuses = "ACTIVE", fields = c("campaign_id", "adset_id", "name", "creative"))
Error in row.names<-.data.frame(*tmp*, value = value) :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ‘1’, ‘2’

Any idea on how to solve it? Thanks and sorry for the trouble!

@daroczig
Copy link
Owner

See #81 for some more details, but in short, you want simplify=FALSE for now and do some postprocessing.

@laziob
Copy link
Author

laziob commented Jan 29, 2018

Haha Im the author of #81, a begginer to R and shiny so sorry for this type of questions :(
I tried using simplify = FALSE and still get the same error though.

@daroczig
Copy link
Owner

Ah, sorry, I totally missed you are the author of both tickets :)
Let me try to clarify this with some additional docs and suggested workaround -- later this week.

@laziob
Copy link
Author

laziob commented Jan 29, 2018

Thank you very much! Looking foward to it. If somehow I come up to a solution I'll keep you posted.

@laziob
Copy link
Author

laziob commented Jan 30, 2018

Just a headsup, the issue appears to be located on the do.call(rbind, res) of the fbad_list_ads function

Warning: non-unique values when setting 'row.names': ‘1’, ‘2’, ‘3’, ‘4’
Warning: Error in row.names<-.data.frame: duplicate 'row.names' are not allowed
Stack trace (innermost first):
75: row.names<-.data.frame
74: row.names<-
73: rownames<-
72: rbind
71:
70: do.call
69: FUN
68: lapply
67: fbad_list_ad
66: getAds [funcionesFb.R#24]
65: observeEventHandler [C:\Users\LazioB\Documents\r_leadaki\r_leadaki\ShinyTuto/app.R#47]
1: runApp

@daroczig
Copy link
Owner

Hm, probably the simplify = FALSE option is handled correctly only if length(id) == 1 when using fbad_list_ads .. .can you please double check? If that's the case, then I think it's an easy fix in the package -- I was not actively using the batch feature of this function.

@laziob
Copy link
Author

laziob commented Jan 30, 2018

Exactly, when running fbad_list_ad with just 1 id, the simplify = FALSE works, but when running with vector, as example:
adlisttest2 <- fbad_list_ad(id = c("23842697638530776", "23842658373930776", "23842658373830776"), statuses = "ACTIVE", fields = c("campaign_id", "adset_id", "name", "creative"), simplify = FALSE)

it returns the Error in row.names<-.data.frame(*tmp*, value = value) :
duplicate 'row.names' are not allowed

I tried modifying it locally on the package code to see if I could find a fix but had no luck due to lack of deeper knowledge 😢

@daroczig daroczig self-assigned this Jan 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants