minMSE (version 0.3.1)

count_occurrences: Count of Equal Treatment Vectors

Description

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).

Usage

count_occurrences(df_treatments, curr_treatment)

Arguments

df_treatments

dataframe containing all the discovered treatment vectors.

curr_treatment

treatment vector to be investigated.

Value

Returns the number of treatment assignment vectors which are equal to the one being investigated.

Examples

Run this code
# NOT RUN {
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))
# }

Run the code above in your browser using DataCamp Workspace