Nothing
# Create a sample data frame for testing
sample_data <- data.frame(
ID = 1:10,
Name = c("Alice", "Bob", "Charlie", "David", "Eve", "Frank", "Grace", "Hannah", "Ivy", "Jack")
)
# Test case 1: Custom number of rows (e.g., 3)
test_that("Custom number of rows (e.g., 3)", {
result <- randrows(sample_data, n = 3)
expect_true(nrow(result) == 3)
})
# Test case 2: Ensure n is not bigger than the actual number of rows
test_that("Ensure n is not bigger than the actual number of rows", {
expect_error(randrows(sample_data, n = 11))
})
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.