toCharacter: Force dataframe columns to character

Description Usage Arguments Value Examples

View source: R/toCharacter.R

Description

Converts designated columns of a dataframe to character. Defaults to converting columns id, sire, and dam.

Usage

1
toCharacter(df, headers = c("id", "sire", "dam"))

Arguments

df

a dataframe where the first three columns can be coerced to character.

headers

character vector with the columns to be converted to character class. Defaults to c("id", "sire", "dam")/

Value

A dataframe with the specified columns converted to class "character" for display with xtables (in shiny)

Examples

1
2
3
4
5
6
library(nprcgenekeepr)
pedGood <- nprcgenekeepr::pedGood
names(pedGood) <- c("id", "sire", "dam", "sex", "birth")
class(pedGood[["id"]])
pedGood <- toCharacter(pedGood)
class(pedGood[["id"]])

rmsharp/nprcmanager documentation built on April 24, 2021, 3:13 p.m.