I am new to R and I am trying to view gene expression differences between tumour vs normal using a TCGA.GTEX dataset. I am trying to find the log fold change for all columns.
This is the code I applied:
GELogFoldChanges <- apply(TCGA_GTEX_lung[-7], 2, function(x) log(sum(x[1:1011]/sum(x[1012:1299])))
But this error occurs:
Error in sum(x[1:1011]) : invalid 'type' (character) of argument
What does this error mean and how should I correct this code?