edit_tar {spatialHeatmap} | R Documentation

## Edit Targets Files

### Description

Replace existing entries in a chosen column of a targets file with desired ones.

### Usage

    edit_tar(df.tar, column, old, new, sub.row)

### Arguments

`df.tar` | The data frame of a targets file.
`column` | The column to edit, either the column name or an integer of the column index.
`old` | A vector of existing entries to replace, where the length must be the same with `new`.
`new` | A vector of desired entries to replace that in `old`, where each entry corresponds to a counterpart in `old` respectively.
`sub.row` | A vector of integers corresponding to target rows for editing, or a vector of TRUE and FALSE corresponding to each row. Default is all rows in the targets file.

### Value

A data frame.

### Author(s)

Jianhai Zhang jzhan067@ucr.edu; zhang.jianhai@hotmail.com
Dr. Thomas Girke thomas.girke@ucr.edu

### References

Mustroph, Angelika, M Eugenia Zanetti, Charles J H Jang, Hans E Holtan, Peter P Repetti, David W Galbraith, Thomas Girke, and Julia Bailey-Serres. 2009. “Profiling Translatomes of Discrete Cell Populations Resolves Altered Cellular Priorities During Hypoxia in Arabidopsis.” Proc Natl Acad Sci U S A 106 (44): 18843–8

### Examples

    sh.tar <- system.file('extdata/shinyApp/example/target_arab.txt', package='spatialHeatmap')
    target.sh <- read_fr(sh.tar)
    target.sh.new <- edit_tar(df.tar=target.sh, column='condition', old=c('control', 'hypoxia'),
    new=c('C', 'H'), sub.row=c(1:12))

[Package spatialHeatmap version 1.2.0 Index]