The data is as follows :
a <- c('id1','id2','id3','id4','id5')
b <- c(5,10,7,2,3)
d <- c(5.2,150,123,5,7)
e <- c(5.4,0,10,3,5)
df1 <- data.frame(a,b,d,e)
I want to create a new column in this data frame returning TRUE and FALSE. It should be true if all the values are within 5% difference of each other, else false.
For example, for 'id1' the values are 5,5.2,5.4 respectively for b,d and e column. So all these are within 5% of each other hence the new_col should be true. For 'id2' the values are 10,150,0 respectively for b,d and e column.So, they are not with 5% of each other, hence it should be false.
Desired Output
