Learn R Programming

nanny (version 0.1.8)

lower_triangular: Keep rows corresponding of a lower triangular matrix built from two columns

Description

lower_triangular() takes as imput a `tbl` formatted as | <element> | <feature> | <value> | <...> | and returns a filtered `tbl`

Usage

lower_triangular(.data, .col1, .col2, .value)

# S4 method for spec_tbl_df lower_triangular(.data, .col1, .col2, .value)

# S4 method for tbl_df lower_triangular(.data, .col1, .col2, .value)

Arguments

.data

A `tbl`

.col1

A column name

.col2

A column name

.value

A column names of the value column

Value

A `tbl` with filtered rows

A `tbl` with filled abundance

A `tbl` with filled abundance

Details

maturing

...

Examples

Run this code
# NOT RUN {
library(dplyr)
library(purrr)
library(tidyr)

mtcars_tidy_permuted = 
  mtcars_tidy %>% 
  filter(feature == "mpg") %>% 
  head(5) %>% 
  permute_nest(car_model, c(feature,value))

mtcars_tidy_permuted %>%
 # Summarise mpg
 mutate(data = map(data, ~ .x %>% summarise(mean(value)))) %>%
unnest(data) %>%

# Lower triangular
lower_triangular(car_model_1, car_model_2,  `mean(value)`)

# }

Run the code above in your browser using DataLab