Diff of /man/process_heatdata.Rd [000000] .. [0f2269]

Switch to unified view

a b/man/process_heatdata.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/ProcessHeatdata.R
3
\name{process_heatdata}
4
\alias{process_heatdata}
5
\title{Process Heatmap Data with Various Selection Options}
6
\usage{
7
process_heatdata(
8
  heatdata,
9
  selection = 1,
10
  custom_names = NULL,
11
  num_names_per_group = NULL,
12
  prefix_length = 4
13
)
14
}
15
\arguments{
16
\item{heatdata}{A data frame containing the heatmap data.}
17
18
\item{selection}{An integer specifying the processing method:
19
- 1: Use custom names for columns.
20
- 2: Select a given number of columns per group based on a prefix.
21
- 3: Calculate the average of columns per group based on a prefix.}
22
23
\item{custom_names}{A character vector of custom names for columns (used when `selection = 1`).
24
The length of this vector must match the number of columns in `heatdata`.}
25
26
\item{num_names_per_group}{An integer specifying the number of columns to select per group (used when `selection = 2`).}
27
28
\item{prefix_length}{An integer specifying the length of the prefix for grouping columns (used when `selection = 2` or `selection = 3`).
29
Default is 4.}
30
}
31
\value{
32
A processed data frame based on the specified selection option.
33
}
34
\description{
35
This function processes heatmap data (`heatdata`) based on a given selection option.
36
It allows customization of column names, selection of specific columns per group,
37
or averaging columns based on a common prefix.
38
}
39
\examples{
40
# Example heatmap data frame
41
heatdata <- data.frame(
42
  groupA_1 = c(1, 2, 3),
43
  groupA_2 = c(4, 5, 6),
44
  groupB_1 = c(7, 8, 9),
45
  groupB_2 = c(10, 11, 12)
46
)
47
48
# Selection 1: Use custom names for columns
49
custom_names <- c("Sample1", "Sample2", "Sample3", "Sample4")
50
processed_data1 <- process_heatdata(heatdata, selection = 1, custom_names = custom_names)
51
52
# Selection 2: Select a given number of columns per group based on a prefix
53
processed_data2 <- process_heatdata(heatdata, selection = 2, num_names_per_group = 1)
54
55
# Selection 3: Calculate the average of columns per group based on a prefix
56
processed_data3 <- process_heatdata(heatdata, selection = 3, prefix_length = 6)
57
}