R/utils.R

Defines functions showSome dfConvertColumns

Documented in dfConvertColumns

dfConvertColumns <- function(x, from = "character", to = "factor") {
    idx = sapply(x, is, from)
    x[idx] = lapply(x[idx], as, to)
    return(x)
}


setAs("character", "factor", function(from) {
    return(as.factor(from))
})


showSome <- function(x, name, indent="") {
    res <- sprintf("%s%s (%d): %s\n",
                   indent,
                   name,
                   length(x),
                   paste(selectSome(x), collapse=", ")
                   )
    return(res)
}

Try the SomaticSignatures package in your browser

Any scripts or data that you put into this service are public.

SomaticSignatures documentation built on Nov. 8, 2020, 5:52 p.m.