inspect {observer}R Documentation

Inspect observations

Description

Once a table has been observed with observe_if, one may wish to dig into the observations made. The function inspect returns a sub-table of .data whose rows correspond to the rows identified by the observation ob.

Usage

inspect(.data, ob, cols = "all")

Arguments

.data

A tbl or data frame.

ob

integer. A row of the observations attribute to be inspected.

cols

character. One of "all", "most", "some". If cols = "all", all .data columns are kept in the result. If cols = "some", only columns that are concerned by the observation ob are kept. cols = "most" is like cols = "some", except that columns which are of type "character" or "factor" are also kept.

See Also

observe_if in this package.

Examples

library(magrittr)

df <- data.frame(id = c("a", "b", "c"), x = 1:3, y = 2:4, z = c(1.1, 10, 5))
df <- df %>% 
  observe_if(z==floor(z), 
             y-x==1, 
             x < 3) %>% 
  observe_if(y < 4, 
             x > 1)
  
print(obs(df))

df1 <- df %>%  
  inspect(ob = 5, cols="most")
print(obs(df1))


[Package observer version 0.1.2 Index]