subset_frame | R Documentation |
The "subset_frame"
function is a subsetting function
intended to produce equivalently size subsets from a single data frame.
This is done by evaluating the number of observations in the original data
set and calculating how many rows should be in each subset for a given
number of subsets.
The purpose behind "subset_frame"
is to break apart large data frames
into smaller ones for the sake of efficiency. This could be useful for
test sets for code or method testing, etc.
subset_frame(.data = NULL, n = NULL)
.data |
data.frame; a data.frame with any number of columns or rows to be sub-setted to equally sized sub-frames. |
n |
numeric; value of the number of sub-frames desired. Defaults
to |
array with dimensions as sub-frame rows, sub-frame columns, and and sub-frame index.
# Data.frame of 100 random observations from normal and uniform df <- data.frame("X" = rnorm(100, 0, 1), "Y" = runif(100, 0, 1)) # Sub-frame to 2 data frames subset_frame(df, 2) # Sub-frame with default sub-framing subset_frame(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.