If the goal of the assign() code around line 109 below is to return the full botchecking and tweet data to the user, then we should do so explicitly. Instead of assigning to the user's global environment, I propose we return a list of length 3:
the full data
the user-level estimate
the conversation-level estimate
and then we remove the argument user_level. It's trivial to calculate both.
The code in question:
# Assign resulting dataframe to global environment
assign("df", df_userbots, envir = globalenv())
If the goal of the
assign()
code around line 109 below is to return the full botchecking and tweet data to the user, then we should do so explicitly. Instead of assigning to the user's global environment, I propose we return a list of length 3:and then we remove the argument
user_level
. It's trivial to calculate both.The code in question: