longdf2gctMatrix: Convert a long data.frame into a GctMatrix

View source: R/read_gct.R

longdf2gctMatrixR Documentation

Convert a long data.frame into a GctMatrix

Description

Convert a long data.frame into a GctMatrix

Usage

longdf2gctMatrix(
  longdf,
  row.col = 1L,
  desc.col = 2,
  column.col = 3,
  value.col = 4,
  missingValue = NULL
)

Arguments

longdf

A data.frame object

row.col

Integer or character string, index or name of the column in which row names are stored

desc.col

Integer or character string,, index or name of the column in which feature descriptions are stored

column.col

Integer or character string, index or name of the column in which sample names are stored

value.col

Integer or character string, index or name of the column in which values are stored

missingValue

Value used for missing values. If NULL, missing values are reported as NA and a warning will be raised if any value is missing. If NA, missing values are reported as NA and no warning is raised.

Value

A GctMatrix object

Examples

idir <- system.file("extdata", package="ribiosIO")
sample.gct.file <- file.path(idir, "test.gct")
test.mat <- read_gct_matrix(sample.gct.file, keep.desc=TRUE)
test.long <- gctMatrix2longdf(test.mat)
test.rmat <- longdf2gctMatrix(test.long)

ribiosIO documentation built on Feb. 20, 2026, 5:09 p.m.