Description Usage Arguments Value Examples
Convert a column to numeric if possible and ignore given columns composed of lists
1 | getNumerics(table, by = NULL, toNumeric = FALSE)
|
table |
Data matrix: table |
by |
Character: column names of interest |
toNumeric |
Boolean: which columns to convert to numeric |
Processed data matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 | event <- read.table(text = "ABC123 + 250 300 350
DEF456 - 900 800 700")
names(event) <- c("Event ID", "Strand", "C1.end", "A1.end", "A1.start")
# Let's change one column to character
event[ , "C1.end"] <- as.character(event[ , "C1.end"])
is.character(event[ , "C1.end"])
event <- psichomics:::getNumerics(event, by = c("Strand", "C1.end", "A1.end",
"A1.start"),
toNumeric = c(FALSE, TRUE, TRUE, TRUE))
# Let's check if the same column is now integer
is.numeric(event[ , "C1.end"])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.