modalClass: Determines most common classes, based on counts for each...

Description Usage Arguments Details Value

View source: R/sharedSupport.r

Description

foo<-subset(df, select='uid') foo$mode <- NA for(i in 1:nrow(df)) foo$mode[i] <- modalClass(df[i] , c('count1','count2','count3'...) , c('ones','twos','threes',...) )

Usage

1
modalClass(x, values, classes)

Arguments

x

named values of interest, e.g. a single row of a dataframe

values

list of column names in x containing cover or other values on which the modal class will be based.

classes

list of class names associated with the columns, given in the order that the values are listed.

Details

ASSUMPTIONS Column names listed by values arg occur in x. The list of class names is in the same order as the list of The number of elements in values is the number of elements in classes.

Value

a character vector


jasonelaw/nrsa documentation built on Nov. 8, 2019, 11:34 a.m.