cut3d: classify 3D data according to rules

cut3dR Documentation

classify 3D data according to rules

Description

classify 3D data according to rules

Usage

cut3d(df1, dfclass, def = 1)

Arguments

df1

data.frame with three columns of numerical data that is to be classified (i.e. assigned a number)

dfclass

data.frame with the rules used for classifying. See Details

def

numeric value that is assigned to row of df1 when no rule is satisfied

Details

dfclass (containing the rules) is a data.frame with seven columns: tree times the lower and upper boundary of each of three dimensions and the numeric value that is assigned when a row from df1 satisfies the rule. A row satifies a rule if each of its fields has a value in the range ⁠[lower,upper]⁠ or when the lower bound is NaN. If the rule is not satisfied, the next rule is checked and so on.

Examples

## Not run: 
d123tab <- tibble::tribble(
  ~d1L, ~d1U, ~d2L, ~d2U, ~d3L, ~d3U, ~r ,
   1,    1,    1,    1,    NaN,  NaN, 1 ,
   1,    1,    2,    3,    NaN,  NaN, 2 ,
   1,    1,    4,    4,    1,    1,   3 ,
   1,    1,    4,    5,    2,    3,   4 ,
   1,    1,    NaN,  NaN,  4,    10,   5
)

mymat <- tibble::tribble(
  ~d1, ~d2, ~d3,
  1, 1, 6,
  1, 4, 1,
  1, 4, 6 ,
  1, 4, 12
)

cut3d(mymat,d123tab)
# [1] 1 3 5 1


## End(Not run)


HanOostdijk/HOQCutil documentation built on July 28, 2023, 5:56 p.m.