Relative Content

Tag Archive for rdplyrtibble

Remove only the rows failed a test inside a group where a row passed the test

Background: I am using R to help me figure out which entries in file A (expected names) map to which entries in file B (possible names). Unfortunately, file B has multiple entries with the same ID and different names. Sometimes these names are exact matches of the ID in file A, but other times they are close or reworded. For now, I am finding those direct 1:1 matches, and removing the non-matches with the same ID.

R Remove only the rows failed a test inside a group where a row passed the test

Background: I am using R to help me figure out which entries in file A (expected names) map to which entries in file B (possible names). Unfortunately, file B has multiple entries with the same ID and different names. Sometimes these names are exact matches of the ID in file A, but other times they are close or reworded. For now, I am finding those direct 1:1 matches, and removing the non-matches with the same ID.

`dplyr::mutate` with Logical Expressions Involving Factors

I am trying to mutate a new column in an R tibble which is a logical equation of existing factor columns. I keep encountering the error the condition has length > 1 despite the simple control flow of my problem. My actual code has a more complex logical flow and works fine on some factor columns but not others.