powered by
expand2 generates duplicated observations within a dataframe.
expand2
expand2(data, n_n = NULL, copies = 2, original = TRUE)
a data frame object
index or indexes specifying row numbers
desired number of copies
a logical indicating whether to keep the original dataframe
data.frame
expand2 appends observations from the dataframe with n copies of the observations with specified indexes of observations or all data.
# NOT RUN { ## create duplicates x <- expand2(infert, 1:5, copies = 2) ## check duplicates report and rmeove dup duplicates(x, drop = TRUE) # }
Run the code above in your browser using DataLab