Learn R Programming

Causata (version 4.2-0)

ReplaceOutliers.CausataData: Replace outliers in a CausataData object.

Description

Outliers are replaced in a CausataData object, and the limits are stored so that they can be re-applied when scoring.

Usage

"ReplaceOutliers"(this, variableName, lowerLimit=NULL, upperLimit=NULL, ...)

Arguments

this
A CausataData object.
variableName
The name of the variable within the causataData object that will have outliers replaced.
lowerLimit
upperLimit
...
Extra unused arguments.

Value

Returns a CausataData object.

See Also

CausataData, CausataVariable, ReplaceOutliers.

Examples

Run this code
df <- data.frame(variable1__All.Past=c(1,2,3,4,1000))
# create CausataData object
causataData <- CausataData(df, rep(0,nrow(df)))
# max is 1000 before outliers are replaced
max(causataData$df$variable1__All.Past) 
causataData <- ReplaceOutliers(causataData, 'variable1__All.Past', upperLimit=4)
# now max is 4 after outliers are replaced
max(causataData$df$variable1__All.Past) 

Run the code above in your browser using DataLab