R/updateRowDataCol.R

Defines functions updateRowDataCol

Documented in updateRowDataCol

updateRowDataCol<- function(x,  updateCol, value){
	tmp<- x
	if(is.numeric(updateCol) | 
		length(which(!is.na(match(updateCol, colnames(
			SummarizedExperiment::rowData(tmp))))))>0){
		SummarizedExperiment::rowData(tmp)[,updateCol]<-value
	} else {		
		tmpDat<- cbind( as.data.frame(SummarizedExperiment::rowData(x)), value)
		colnames(tmpDat)[ncol(tmpDat)]<- updateCol
		SummarizedExperiment::rowData(tmp)<- S4Vectors::DataFrame(tmpDat)
	}

	return(tmp)
}

Try the IntEREst package in your browser

Any scripts or data that you put into this service are public.

IntEREst documentation built on Nov. 8, 2020, 8:05 p.m.