#' Drop empty lines and columns from the specified data frame.
#' 
#' This function drops all the empty lines and columns from the specified data
#' frame, i.e. all the rows and columns that contain only NAs.
#' 
#' @param dataframe `data.frame`. The data frame from which to remove the empty
#'   lines and columns.
#' 
#' @return The provided data frame without empty lines and columns and all the
#'   types transformed to string.
#' 
#' @importFrom checkmate assert_data_frame
#' @importFrom dplyr filter select where mutate_all
#' 
#' @examples
#' # The first row is going to be dropped.
#' irisTest_ <- iris
#' irisTest_[1, ] <- NA
#' irisTestDropped <- dropEmpty(irisTest_)
#' 
#' # The Species column is going to be dropped.
#' irisTest_ <- iris
#' irisTest_$Test <- NA
#' irisTestDropped <- dropEmpty(irisTest_)
#' 
#' @export
#' 
dropEmpty <- function(dataframe) {

  assert_data_frame(dataframe)

  rowSum_ <- rowSums(is.na(dataframe))

  dataframe <- dataframe |>
    filter(rowSum_ != ncol(dataframe)) |>
    select(where(~ !all(is.na(.)))) |>
    mutate_all(as.character)

  return(dataframe)
}
