Nothing
#' Shuffle Elements Within Each Sequence
#'
#' This function shuffles the elements within each sequence independently.
#'
#' @param sequences A character vector of sequences to shuffle.
#' @return A character vector of sequences with elements shuffled within each sequence.
#' @examples
#' # Example usage:
#' sequences <- c("A B C", "D E F", "G H I")
#' result <- shuffle_sequences_within(sequences)
#' print(result)
#' @export
shuffle_sequences_within <- function(sequences) {
shuffled_sequences <- sapply(sequences, function(seq) {
elements <- strsplit(seq, " ")[[1]]
shuffled_elements <- sample(elements)
paste(shuffled_elements, collapse = " ")
})
return(shuffled_sequences)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.