It unlists it. So, I when I make it a dataframe again I lose the names of the diagnoses. Is there a simpler way to do this without having to make a separate list with the names? I just want to remove that one row. Subsetting doesn't work either. I get an error that the comparison is only possible for atomic and list types.
Asked
Active
Viewed 46 times
0
-
Why did you remove all the data and code from your question? – camille Oct 06 '20 at 01:49
-
I was informed to redact data and change it for data integrity concerns. Using the exact file names was too much so I'm going back and will add new redacted data all over again. – Oct 09 '20 at 01:25
-
You can always create mockup data or use data that comes with common packages—lots of suggestions [here](https://stackoverflow.com/q/5963269/5325862). Right now it's impossible to know what the question is, since there's no code, data, or output – camille Oct 09 '20 at 14:23
1 Answers
-2
It is because by default the data.frame
, drop = TRUE
, so it drops the dimensions when there is a single row/column to return a vector. We can specify drop = FALSE
(It won't happen if the object is tibble
or data.table
)
DiagnosesCount2[-c(31),, drop = FALSE]

akrun
- 874,273
- 37
- 540
- 662