Highlight some rows in a data frame

highlight(x, sel)

Arguments

x

data frame like object

sel

logical vector of length equal to number of rows in the data frame.

Details

Uses print.colorDF() to highlight selected rows in a data frame.

Examples

highlight(mtcars, mtcars$cyl == 6)
#> # Data frame like object (class data.frame) 11 x 32:
#> # (Showing rows 1 - 20 out of 32)
#>                    │mpg  │cyl  │disp │hp   │drat │wt   │qsec │vs   │am   │gear 
#>                    │<dbl>│<dbl>│<dbl>│<dbl>│<dbl>│<dbl>│<dbl>│<dbl>│<dbl>│<dbl>
#>           Mazda RX4│   21│    6│  160│  110│  3.9│  2.6│   16│    0│    1│    4
#>       Mazda RX4 Wag│   21│    6│  160│  110│  3.9│  2.9│   17│    0│    1│    4
#>          Datsun 710│   23│    4│  108│   93│  3.9│  2.3│   19│    1│    1│    4
#>      Hornet 4 Drive│   21│    6│  258│  110│  3.1│  3.2│   19│    1│    0│    3
#>   Hornet Sportabout│   19│    8│  360│  175│  3.1│  3.4│   17│    0│    0│    3
#>             Valiant│   18│    6│  225│  105│  2.8│  3.5│   20│    1│    0│    3
#>          Duster 360│   14│    8│  360│  245│  3.2│  3.6│   16│    0│    0│    3
#>           Merc 240D│   24│    4│  147│   62│  3.7│  3.2│   20│    1│    0│    4
#>            Merc 230│   23│    4│  141│   95│  3.9│  3.1│   23│    1│    0│    4
#>            Merc 280│   19│    6│  168│  123│  3.9│  3.4│   18│    1│    0│    4
#>           Merc 280C│   18│    6│  168│  123│  3.9│  3.4│   19│    1│    0│    4
#>          Merc 450SE│   16│    8│  276│  180│  3.1│  4.1│   17│    0│    0│    3
#>          Merc 450SL│   17│    8│  276│  180│  3.1│  3.7│   18│    0│    0│    3
#>         Merc 450SLC│   15│    8│  276│  180│  3.1│  3.8│   18│    0│    0│    3
#>  Cadillac Fleetwood│   10│    8│  472│  205│  2.9│  5.2│   18│    0│    0│    3
#> Lincoln Continental│   10│    8│  460│  215│  3.0│  5.4│   18│    0│    0│    3
#>   Chrysler Imperial│   15│    8│  440│  230│  3.2│  5.3│   17│    0│    0│    3
#>            Fiat 128│   32│    4│   79│   66│  4.1│  2.2│   19│    1│    1│    4
#>         Honda Civic│   30│    4│   76│   52│  4.9│  1.6│   19│    1│    1│    4
#>      Toyota Corolla│   34│    4│   71│   65│  4.2│  1.8│   20│    1│    1│    4
#> # 1 more columns: carb (<dbl>)