makeExampleMatchedDataSet {nullranges} | R Documentation

## Function for generating an example matchRanges or Matched dataset

### Description

This function will generate an example dataset as either 1) input for `matchRanges()` (when `matched = FALSE`) or 2) a Matched Object (when `matched = TRUE`).

### Usage

    makeExampleMatchedDataSet(
      type = "DataFrame",
      matched = FALSE,
      method = "rejection",
      replace = FALSE,
      ...
    )

    ## S4 method for signature
    ## 'character_OR_missing,
    ##   logical_OR_missing,
    ##   character_OR_missing,
    ##   logical_OR_missing'
    makeExampleMatchedDataSet(type, matched, method, replace)

### Arguments

`type` | Character designating which type of dataset to make. options are one of 'data.frame', 'data.table', 'DataFrame', 'GRanges', or 'GInteractions'.
`matched` | TRUE/FALSE designating whether to generate a Matched dataset (`matched = TRUE`) or an input dataset for `matchRanges()` (`matched = FALSE`).
`method` | Character describing which matching method to use. Supported options are either 'nearest', 'rejection', or 'stratified'.
`replace` | TRUE/FALSE describing whether to select matches with or without replacement.
`...` | Additional arguments

### Details

When `matched = FALSE`, the data returned contains 3 different features that can be subset to perform matching.

### Value

Returns an example Matched dataset or an example dataset for input to `matchRanges()`.

### Examples

    ## Make examples for matchRanges() (i.e matched = FALSE)
    set.seed(123)
    makeExampleMatchedDataSet()
    head(makeExampleMatchedDataSet(type = 'data.frame', matched = FALSE))
    makeExampleMatchedDataSet(type = 'data.table', matched = FALSE)
    makeExampleMatchedDataSet(type = 'DataFrame', matched = FALSE)
    makeExampleMatchedDataSet(type = 'GRanges', matched = FALSE)
    makeExampleMatchedDataSet(type = 'GInteractions', matched = FALSE)

    ## Make Matched class examples (i.e. matched = TRUE)
    set.seed(123)
    makeExampleMatchedDataSet(matched = TRUE)
    makeExampleMatchedDataSet(type = 'DataFrame', matched = TRUE,
                              method = 'rejection',
                              replace = FALSE)
    makeExampleMatchedDataSet(type = 'GRanges', matched = TRUE,
                              method = 'rejection',
                              replace = FALSE)
    makeExampleMatchedDataSet(type = 'GInteractions', matched = TRUE,
                              method = 'rejection',
                              replace = FALSE)

[Package nullranges version 1.0.1 Index]