Learn R Programming

act (version 1.3.1)

helper_transcriptNames_set: Helper: Set names of all transcripts in a corpus

Description

Sets the names of all transcript objects in a corpus object both in the names of the list x@transcripts and in the slot @name of each transcript.

Usage

helper_transcriptNames_set(x, transcriptNames)

Value

List

Arguments

x

Corpus object

transcriptNames

Vector of character strings; new names.

Examples

Run this code
library(act)

# get current names of the transcripts
names.old <- act::helper_transcriptNames_get(examplecorpus)

# rename giving numbers as names
names.test <- as.character(seq(1:length(names.old)))
test <-  act::helper_transcriptNames_set(examplecorpus, names.test)
names(test@transcripts)

# create an error: empty name
if (FALSE) {
names.test <- names.old
names.test[2] <- " "
test <-  act::helper_transcriptNames_set(examplecorpus, names.test)
}

# create an error: double names
if (FALSE) {
names.test <- names.old
names.test[2] <- names.test[1]
test <-  act::helper_transcriptNames_set(examplecorpus, names.test)
}

Run the code above in your browser using DataLab