get_grooves_rollapply: Using rollapply to find grooves in a crosscut

Description Usage Arguments Examples

View source: R/get_grooves_rollapply.R

Description

Using rollapply to find grooves in a crosscut

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
get_grooves_rollapply(
  x,
  value,
  smoothfactor = 15,
  adjust = 10,
  groove_cutoff = 400,
  mean_left = NULL,
  mean_right = NULL,
  mean_window = 100,
  second_smooth = T,
  which_fun = mean,
  return_plot = F
)

Arguments

x

numeric vector of locations (in microns)

value

numeric values of surface measurements in microns

smoothfactor

The smoothing window to use

adjust

positive number to adjust the grooves

groove_cutoff

The index at which a groove cannot exist past

mean_left

If provided, the location of the average left groove

mean_right

If provided, the location of the average right groove

mean_window

The window around the means to use

second_smooth

Whether or not to smooth a second time

which_fun

Which function to use in the rollapply statement

return_plot

return plot of grooves?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
# Set the data up to be read in, cleaned, etc.
library(bulletxtrctr)
library(x3ptools)

example_data <- bullet_pipeline(
  location = list(Bullet1 = c(hamby252demo$bullet1[3])),
  stop_at_step = "crosscut",
  x3p_clean = function(x) x %>%
      x3p_scale_unit(scale_by = 10^6) %>%
      rotate_x3p(angle = -90) %>%
      y_flip_x3p()
)

get_grooves_rollapply(example_data$ccdata[[1]]$x,
  example_data$ccdata[[1]]$value,
  adjust = 30, return_plot = T
)
cc_locate_grooves(example_data$ccdata[[1]],
  method = "rollapply",
  adjust = 30, return_plot = T
)

## End(Not run)

heike/grooveFinder documentation built on Dec. 31, 2019, 12:33 p.m.