count_occurrences | R Documentation |
Checks if the treatment vector given as argument already exists in the dataframe, i.e., has been produced by one or more earlier iteration(s).
count_occurrences(df_treatments, curr_treatment)
df_treatments |
dataframe containing all the discovered treatment vectors. |
curr_treatment |
treatment vector to be investigated. |
Returns the number of treatment assignment vectors which are equal to the one being investigated.
Sebastian Schneider sschneider@coll.mpg.de; sebastian@sebastianschneider.eu, Giulia Baldini giulia.baldini@uni-bonn.de
df_treatments <- data.frame(c(0, 2, 0, 1, 1, 0, 2, 1, 1, 0), c(0, 2, 0, 1, 2, 0, 1, 2, 1, 0), c(0, 2, 1, 1, 2, 0, 0, 2, 0, 0)) colnames(df_treatments) <- c("treatment_iter_1", "treatment_iter_2", "treatment_iter_3") count_occurrences(df_treatments, c(0, 2, 1, 1, 2, 0, 0, 2, 0, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.