Fix Data Entry Errors in a Voting Result Tracker
You can now remove databin entries.
Create a databin to store election results as they come in.
In[1]:=
votes = CreateDatabin[]
Populate the databin and plot the fraction of the vote for each choice so far.
In[2]:=
DatabinUpload[votes,
data = {<|"Alpha" -> 34, "Beta" -> 12, "Gamma" -> 7|>, <|
"Alpha" -> 44, "Beta" -> 19, "Gamma" -> 9|>, <|"Alpha" -> 52,
"Beta" -> 19, "Gamma" -> 11|>, <|"Alpha" -> 68, "Beta" -> 22,
"Gamma" -> 18|>, <|"Alpha" -> 78, "Beta" -> 24,
"Gamma" -> 20|>}];
show complete Wolfram Language input
Out[3]=
A manually entered data point accidentally switches values for two candidates and can be seen as an incorrect crossing in the plot.
In[4]:=
DatabinAdd[votes, <|"Alpha" -> 86, "Beta" -> 22, "Gamma" -> 26|>];
show complete Wolfram Language input
Out[5]=
Correct the databin by removing the most recent entry and adding the correct entry.
In[6]:=
DatabinRemove[votes, -1];
In[7]:=
DatabinAdd[votes, <|"Alpha" -> 86, "Beta" -> 26, "Gamma" -> 22|>];
show complete Wolfram Language input
Out[8]=