Dear all,
I am trying to subset my RangeSummarizedExperiment with se[, se$name == lung]. However, when doing so I keep getting this error: Error: logical subscript contains NAs
Does anyone has an idea how I can subset it nevertheless?
Thank you & Best Regards, Bine
Hi James,
thanks for your answer. Sorry I forget the " " around lung in the post here, but did put it in my code. It is working now with %in%, that's great, thank you!
Can I ask you one other related question to subsetting of a Summarised Object - I would like to get rid of a column ("primary,site") in colData, but it seems not to work the usual way...
se.small[ , -which(names(se.small) %in% c("primary.site"))]
Do you know how I could do this?
Thank you, Bine
Thank you. But like this it removes all the values and everything is 0.
I should also mention that the structure is as below for this variable of colData:
Primary.site is a list.
Thank you!!!
Rereading your previous post, it's not clear if you want to get rid of a particular column of your
colData
slot, or if you want to filter on things that are in that column (which apparently is called 'primary_site', rather than 'primary.site').If the former, you just replace the
colData
.Or if it's as you seem to imply, that you don't want any of the values in
se.small$names
to be in any of the list items forprimary_site
, then you can usesapply
Yes, I just wanted to get rid of that column in colData, it worked with colData(se.small) <- colData(se.small)[, !names(colData(se.small)) %in% "primary_site"].
Thanks a lot !