Remove unused factor levels from data after limiting

After limiting the data there may be factors with empty levels. This can
be confusing and should be avoided.
This commit is contained in:
Jens Sauer 2020-11-19 13:16:34 +01:00
parent 792b42373e
commit 30c03f01d0

View File

@ -77,6 +77,9 @@ sma_load_data <- function(file) {
# At this time only solid tumors are important
sma <- filter(sma, diagnosis_type == "solid")
# After filtering unused levels must be cleared from the data
sma <- droplevels(sma)
return(sma)
}