highest_in: Find the data frame with greatest amount of columns named a...

Description Usage Arguments Value Examples

View source: R/arrays.R

Description

Given a list/environment of data frames and one or more attributes, it finds the one dataframe having most columns/rows named as specified by the attributes. The default function used for matching is starts_with (dplyr v.1.0.7)

Usage

1
highest_in(listOrEnv, ..., FUN = dplyr::starts_with, row = F)

Arguments

listOrEnv

container of the input dataframes

...

one or more attributes to search by, the type depends on the FUN accepted input (default:character)

FUN

the function to apply for matching column or row names (default: starts_with)

row

if TRUE row names are used for search and scoring

Value

a dataframe from listOrEnv

Examples

1
2
3
4
df1<-mtcars[1:9,];df2<-mtcars[10:16,]
highest_in(list(df1,df2),"Merc",row=T)
highest_in(list(df1,df2),c("Merc","Cadillac"),row=T)
highest_in(list(df1,df2),c("Merc","Valiant"),row=T)

Davz33/lazykitten documentation built on Jan. 28, 2022, 1:56 a.m.