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

View source: R/helper_transcriptNames_set.R

helper_transcriptNames_setR Documentation

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)

Arguments

x

Corpus object

transcriptNames

Vector of character strings; new names.

Value

List

Examples

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
## Not run: 
names.test <- names.old
names.test[2] <- " "
test <-  act::helper_transcriptNames_set(examplecorpus, names.test)

## End(Not run)

# create an error: double names
## Not run: 
names.test <- names.old
names.test[2] <- names.test[1]
test <-  act::helper_transcriptNames_set(examplecorpus, names.test)

## End(Not run)

act documentation built on June 7, 2023, 6:16 p.m.