highlight: Highlight some rows in a data frame

Description Usage Arguments Details Examples

View source: R/tools.R

Description

Highlight some rows in a data frame

Usage

1
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

1
highlight(mtcars, mtcars$cyl == 6)

Example output

colorDF: for best results, use terminals which support 256 colors.
# Data frame like object (class data.frame) 11 x 32:
# (Showing rows 1 - 20 out of 32)mpgcyldisphpdratwtqsecvsamgear 
          Mazda RX42161601103.92.616014
      Mazda RX4 Wag2161601103.92.917014
         Datsun 710234108933.92.319114
     Hornet 4 Drive2162581103.13.219103
  Hornet Sportabout1983601753.13.417003
            Valiant1862251052.83.520103
         Duster 3601483602453.23.616003
          Merc 240D244147623.73.220104
           Merc 230234141953.93.123104
           Merc 2801961681233.93.418104
          Merc 280C1861681233.93.419104
         Merc 450SE1682761803.14.117003
         Merc 450SL1782761803.13.718003
        Merc 450SLC1582761803.13.818003
 Cadillac Fleetwood1084722052.95.218003
Lincoln Continental1084602153.05.418003
  Chrysler Imperial1584402303.25.317003
           Fiat 12832479664.12.219114
        Honda Civic30476524.91.619114
     Toyota Corolla34471654.21.820114carb 
          Mazda RX44
      Mazda RX4 Wag4
         Datsun 7101
     Hornet 4 Drive1
  Hornet Sportabout2
            Valiant1
         Duster 3604
          Merc 240D2
           Merc 2302
           Merc 2804
          Merc 280C4
         Merc 450SE3
         Merc 450SL3
        Merc 450SLC3
 Cadillac Fleetwood4
Lincoln Continental4
  Chrysler Imperial4
           Fiat 1281
        Honda Civic2
     Toyota Corolla1

colorDF documentation built on Nov. 16, 2020, 9:15 a.m.