I have a data set with 5908 rows (now the variables) and 5 columns (observations). The variables take the value 0.00 in some column. I want to sort out the rows that do not have any zero values at all.
df <- read.delim2("permutation.txt")
# Randomly select 5 column names out of 60 (because I actually have 60 columns)
selected_column_names <- sample(colnames(df), 5)
# Select the 5 specified columns from the data frame
selected_data <- df[, selected_column_names]
I would like the rows that do not contain any 0.00 value at all to be sorted out.
Apply a function to each row and save the result into a variable.
Then you can filter your dataset based on the variable. Like:
It is also possible to count how many FALSE in drop if only the number is needed.