View source: R/updateRowDataCol.R
updateRowDataCol | R Documentation |
rowData
of SummarizedExperiment
objects
Updates the values in a single column of the rowData
of
SummarizedExperiment
objects.
updateRowDataCol(x, updateCol, value)
x |
Object of type |
updateCol |
Name or the number of the column in the |
value |
The new Replacing values. |
Returns an object of type SummarizedExperiment
.
Ali Oghabian
annotateU12
test<- mdsChr22Obj
# See the the frequency of each intron type annotation
table(rowData(test)$intron_type)
#Change U2 to u2
newIntType<- as.character(rowData(test)$intron_type)
newIntType[newIntType=="U2" &
!is.na(newIntType=="U2")]<- "u2"
#Updating values
test<- updateRowDataCol(test, updateCol="intron_type",
value=newIntType)
#See the frequency of the updated intron type annotations
table(rowData(test)$intron_type)
#Adding a new column
test<- updateRowDataCol(test, updateCol="new_column",
value=rep(NA, nrow(rowData(test))) )
head(rowData(test))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.