Hello Everyone,
I have a Data type Matrix
from TCGA
database of this:
I converted it to dataFrame
because I want to join the gene symbol
from colData
to it. I got this :
The aim is to use the gene symbol
as features
for my analysis. so. I droped the Esenbl ID
column and transposed
the dataframe with the gene symbol
as columns and samples
as rows.
Then I converted the dataFrame
to matrix
with this code :
expr_2 <- as.matrix(expr_df_3)
but when i checked the class
of expr_2
it shows 'matrix' .'array'
I actually dont understand the reasons behind this .
How can I make this a Matrix
? I have the impression that it will have effect on my Machine Learning Pipeline.
From the dataframe, let's call it df1, on your second screenshot, assuming "gene_name" column values are unique, try:
vinszx , I got this error
Error in parse(text = x, srcfile = src): <text>:2:1: unexpected symbol 1: m <- as.matrix(t(expr[, -c(1,2)]) 2: rownames ^ Traceback:
but, I have already transposed
screenshot 2
withgenesybol
as columns andsamples
as rows. but theclass
remain same.I got this error
Error in parse(text = x, srcfile = src): <text>:2:1: unexpected symbol 1: m <- as.matrix(t(expr[, -c(1,2)]) 2: rownames ^ Traceback:
but, I have already transposed
screenshot 2
withgenesymbol
as columns andsamples
as rows. but theclass
remain same