Relative Content

Tag Archive for rdataframedplyr

How to check if a value from one column is repeated in all other columns in R?

I have a dataset with multiple columns that contains information from different schools. I am standardizing all the information, so all schools display the same information. To do so, I am trying to identify if the same information is displayed in all columns and identify which column and row does not display the same information.

Using `case_when` and `mutate` to search multiple columns for conditional

I am trying to create a new column in my data frame (NEW) using the case_when functionality in dplyr. I am able to get the code below to run, but I am wondering if there is a way to create this new column based on the four columns that start with COL_ as opposed to how it is currently written, looking only at COL_1. Otherwise, I would have to repeat each case four times (once for each COL_1, COL_2, COL_3, and COL_4).