pca_data_tidy: the Principal Components Analysis need the data must be...

Description Usage Arguments Value Examples

View source: R/pca_data_tidy.R

Description

the Principal Components Analysis need the data must be transformed

Usage

1

Arguments

data

the input data must be a dataframe or tibble which' rownames is gene id and colnames is sample name

id

the rowid, can be a character or the column number

Value

a dataframe

Examples

1
2
3
4
5
6
7
8
9
test = matrix(rnorm(200), 20, 10)
test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
colnames(test) = paste("Test", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
annot <- c(rep("KEGG",20))
test <- data.frame(test,annot)
pca_data_tidy(as.data.frame(test)) -> test

wangjiaxuan666/autopca documentation built on Jan. 19, 2021, 6:54 a.m.