You can use the subset
function in R to return the row containing a specific value in two different columns of a data frame. Here's an example:
435 chars17 lines
In this example, subset
is used to filter the rows in the data frame df
where column A is 3
and column B is "cherry"
. The &
operator is used to specify that both conditions should be met.
Make sure to adjust the column names, data values, and comparison operators (==
, >
, <
, etc.) according to your specific use case.
gistlibby LogSnag