Learn R Programming

wrMisc (version 1.15.3.1)

.scaleSpecGrp: Rescale respective to specific group

Description

This function allows to rescale data 'x' so that 2 specific groups get normalized to predefined values (and all other values follow proportionally) 'grp1Num' and 'grp2Num' should be either numeric for positions in 'x' or character for names of 'x'; if 'grp1Num' and/or 'grp2Num' design mulitple locations: perform median or mean summarization, according to 'sumMeth'

Usage

.scaleSpecGrp(
  x,
  grp1Num,
  grp1Val,
  grp2Num = NULL,
  grp2Val = NULL,
  sumMeth = "mean",
  callFrom = NULL
)

Value

numeric vector

Arguments

x

(numeric vector) main input

grp1Num

(numeric)

grp1Val

(numeric)

grp2Num

(numeric)

grp2Val

(numeric)

sumMeth

(character) method for summarizing

callFrom

(character) allow easier tracking of messages produced

See Also

Examples

Run this code
.firstMin(c(4,3:6))

Run the code above in your browser using DataLab