Hi jv,
Yes, it isn't a matrix. After running class(addset) it looks like this:
Hi All,
The function "rownames" and "colnames" extract row and column labels from the dataset.
For some specific purpose, I need to extract a column of strings from a dataset that doesn't seem compatible with the two functions above. It looks like this:
And after running colnames it reports null.
I just wonder if there is any way to extract the first column of this dataset! Any suggestions will be highly appreciated!
thanks
Best,
Max
is any way to extract the first column of this dataset
it looks like you are using R in which case if this is a matrix of data frame then the first column of cells can be accessed using base notations like:
addset[,1]
However this is not the same as colnames or rownames and it is rather strange that your addset object doesn't have row or column names which makes me think that this object is something other than a data frame or matrix. I recommend also running class(addset) to see what type of object this really is.
Log in to answer this question.
how is the dataset created?
by extracting active.ident of a very weird dataset GSE154659_C57_Raw_counts
Thank you for detailed answer. What do you want to extract from counts (RDS object) and how did you extract the counts? In the mean time, try this:
Thank you for the suggestion! I want to extract a string containing cell name and experiment type from the active. ident. However, its syntax does not allow me to do so. I simply ran
addset <- object@active identto extract it.