This function removes rows from both ends of a data frame until it identifies
a row where all columns have non-NA values. Starting from the beginning, it
removes rows until it encounters a row with complete data at a specific row
index (e.g., row 5).
It then proceeds to remove rows from the end of the data frame, eliminating
any rows with at least one NA value in any column.
The process stops when it finds a row where all columns contain non-NA values,
and the resulting data frame is returned.
Usage
remove_na_safe(df , verbose = FALSE )
Value
data.frame returns data.frame after removing rows if all columns are NA
from the beginning and after
Arguments
df
data.frame to remove na rows from the beginning and from the end