Learn R Programming

R4RNA (version 1.0.0)

Coerce to Helix: Coerce to a Helix Data Frame

Description

Functions to coerce a structure into a helix data frame, and to check whether a structure is a valid helix data frame. A helix data frame is a data frame, so any structure coercible into a data.frame can become a helix data frame.

Usage

as.helix(x, length) is.helix(x)

Arguments

x
Structure to coerce. Should be a structure coercible into a standard R data.frame structure for as.helix. Should be a string for parseBracket. May be anything for is.helix.
length
The length of the RNA sequence containing the helices.

Value

is.helix returns a boolean.as.helix returns helix data frame with valid input.

Details

as.helix takes in a data.frame and coerces it into a helix data frame acceptable by other R4RNA functions. This mainly involves setting specific column names and casting to specific types.

Examples

Run this code
    # Not a valid helix data frame
    helix <- data.frame(c(1, 2, 3), seq(10, 20, length.out = 3), 5, runif(3))
    is.helix(helix)
    warnings()
    
    # Formatted into a helix data frame
    helix <- as.helix(helix)
    is.helix(helix)

Run the code above in your browser using DataLab