lower_triangular-methods: Keep rows corresponding of a lower triangular matrix built...

lower_triangularR Documentation

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

Description

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

Usage

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

## S3 method for class 'spec_tbl_df'
lower_triangular(.data, .col1, .col2, .value)

## S3 method for class '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

Details

\lifecycle

maturing

...

Value

A 'tbl' with filtered rows

A 'tbl' with filled abundance

A 'tbl' with filled abundance

Examples


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)`)


stemangiola/nanny documentation built on July 29, 2023, 1:23 a.m.