leifeld / dna

Discourse Network Analyzer (DNA)
126 stars 41 forks source link

dna_barplot does not export all statements #256

Closed TimHenrichsen closed 1 year ago

TimHenrichsen commented 1 year ago

The dna_barplot() function right now only retrieves a smaller fragment of all coded statements.

library(rDNA)

dna_init()
dna_sample()
dna_openDatabase("sample.dna", coderId = 1, coderPassword = "sample")

# Compute barplot data
dna_barplot(statementType = "DNA Statement",
            variable = "concept",
            qualifier = "agreement")

# Compute eventlist data
x <- dna_network(networkType = "eventlist")

table(x$concept)

For the sample database, dna_barplot() only retrieves 5 of the 16 coded statements for the concept "There should be legislation to regulate emissions.", for example.

leifeld commented 1 year ago

Try adding the argument duplicates = "include" to the dna_barplot call. It gives you all 16 instances.

TimHenrichsen commented 1 year ago

Ah! Didn't notice that you changed the default value. Thanks!

leifeld commented 1 year ago

I thought this made more sense as the default value because users might want to see which concepts are most polarising. But if you disagree, please feel free to change the default value in the code while you are at it.

TimHenrichsen commented 1 year ago

No, I do think it makes more sense. I was just used to the old default setting, that's why I didn't pay any attention to the duplicates argument.