Learn R Programming

vascr (version 0.1.4)

vascr_edit_sample: Rename a sample in a vascr dataset

Description

Renames samples in a vascr dataset, either replacing the whole sample or parts of the string.

Usage

vascr_edit_sample(data.df, change_list, partial = TRUE, escape = TRUE)

Value

An updated vascr data frame

Arguments

data.df

Vascr dataset to update

change_list

List of vectors containing pairs of search and replacement terms to replace

partial

TRUE or FALSE, defines if partial matches should be changed

escape

TRUE or FALSE, whether to escape special characters passed into the function

Examples

Run this code
to_rename = growth.df %>% vascr_subset(sample = c("0 cells","20,000 cells", "10,000 cells"))

to_rename$Sample %>% unique()

renamed = vascr_edit_sample(to_rename, change_list = list(c("0_cells", "Cell Free")))
print(renamed$Sample %>% unique())

Run the code above in your browser using DataLab