To reword your question slightly, you want to retain rows where entries in f_name have length of 3 or less. So how about:
subset(m, nchar(as.character(f_name)) <= 3)
More Related Contents:
- Deleting specific rows with a pattern[start and end indicators] from a dataframe [closed]
- Select the row with the maximum value in each group
- Replace values in a dataframe based on lookup table
- Create a sequential number (counter) for rows within each group of a dataframe [duplicate]
- Sample random rows in dataframe
- Extracting specific columns from a data frame
- Find indices of duplicated rows [duplicate]
- How to drop columns by name in a data frame
- Subset / filter rows in a data frame based on a condition in a column
- Replacing character values with NA in a data frame
- Coerce multiple columns to factors at once
- Reshape multiple values at once
- Delete rows that exist in another data frame? [duplicate]
- Cumulatively paste (concatenate) values grouped by another variable
- How to move cells with a value row-wise to the left in a dataframe [duplicate]
- combining two data frames of different lengths [closed]
- Match values in data frame with values in another data frame and replace former with a corresponding pattern from the other data frame
- Find which interval row in a data frame that each element of a vector belongs in
- Comparing two vectors in an if statement
- Splitting a large data frame into smaller segments
- How to add a factor column to dataframe based on a conditional statement from another column?
- mutate_each / summarise_each in dplyr: how do I select certain columns and give new names to mutated columns?
- Should I use a data.frame or a matrix?
- Replace empty values with value from other column in a dataframe
- Split dataframe using two columns of data and apply common transformation on list of resulting dataframes
- Identify records in data frame A not contained in data frame B [closed]
- Replace value with the name of its respective column
- Count unique values for every column
- What you can do with a data.frame that you can’t with a data.table?
- Override column types when importing data using readr::read_csv() when there are many columns