Description Usage Arguments Examples
View source: R/robust_loess_fit.R
Internal function called by get_grooves_lassobasic and get_grooves_lassofull
1 | robust_loess_fit(cc, iter)
|
cc |
data frame with columns x and value_std, representing the crosscut |
iter |
number of iterations |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data("example_data")
head(example_data)
example_data <- example_data[seq(from = 1, to = nrow(example_data), by = 30),]
plot(example_data$x, example_data$y)
# set the minimum y-value to zero
check_min <- min(example_data$value[!is.na(example_data$value)])
example_data <- dplyr::mutate(example_data, value_std = value - check_min)
# remove global structure
rlo_fit <- robust_loess_fit(cc = example_data, iter = 20)
example_data$rlo_pred <- predict(rlo_fit, newdata = example_data)
example_data$rlo_resid <- example_data$value_std - example_data$rlo_pred
# define new data frame without the global structure
data <- data.frame("x" = example_data$x, "y" = example_data$rlo_resid)
plot(data$x, data$y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.