I have a data frame df , and it has few columns & it contains text . I want to drop all elements if their length is less than 4 characters.What I expect is expected_df . Reproducible example is given below .
df<-data.frame(client=c("My Name is abcdff","Name is not right","Bangalore is getting hoter","BBa wasa school topper"),serial_numer=c(1:4))
expected_df<-data.frame(client=c("Name abcdff","Name right","Bangalore getting hoter","wasa school topper"),serial_numer=c(1:4))
This is what I have tried to solve my problem
df$client<-as.character(df$client)
df$client[nchar(df$client) > 3]