From fdc71be913e65ff2586f34ccc439f3182781513a Mon Sep 17 00:00:00 2001 From: "Yuhang (Tom) Lin" Date: Sun, 24 Sep 2023 09:05:14 -0500 Subject: [PATCH] Add return values --- R/data.R | 2 +- R/df_rmtrend_x3p.R | 1 + R/vec_align_sigs_list.R | 1 + R/x3p_MLE_angle_vec.R | 1 + R/x3p_image_autosize.R | 1 + R/x3p_impute.R | 1 + R/x3p_insidepoly_df.R | 1 + R/x3p_quantile_angle_vec.R | 1 + R/x3p_raw_sig_vec.R | 1 + R/x3p_shift_sig_vec.R | 1 + R/x3p_vertical.R | 1 + man/df_rmtrend_x3p.Rd | 3 +++ man/vec_align_sigs_list.Rd | 3 +++ man/x3p_MLE_angle_vec.Rd | 3 +++ man/x3p_image_autosize.Rd | 3 +++ man/x3p_impute.Rd | 3 +++ man/x3p_insidepoly_df.Rd | 3 +++ man/x3p_quantile_angle_vec.Rd | 3 +++ man/x3p_raw_sig_vec.Rd | 3 +++ man/x3p_shift_sig_vec.Rd | 3 +++ man/x3p_subsamples.Rd | 2 +- man/x3p_vertical.Rd | 3 +++ 22 files changed, 42 insertions(+), 2 deletions(-) diff --git a/R/data.R b/R/data.R index 6ea6513..86ce9e8 100644 --- a/R/data.R +++ b/R/data.R @@ -3,5 +3,5 @@ #' A list of wire cuts data set by subsampling factor 10 of the original wire cuts x3p. #' #' @format list -#' A list of x3p objects +#' A list of x3p objects named with surface scan names "x3p_subsamples" diff --git a/R/df_rmtrend_x3p.R b/R/df_rmtrend_x3p.R index f644510..8ae20be 100644 --- a/R/df_rmtrend_x3p.R +++ b/R/df_rmtrend_x3p.R @@ -4,6 +4,7 @@ #' @param x3p x3p object #' @param mask_col colour for the polygon #' @param concavity strictly positive value used in \code{concaveman::concaveman} +#' @return x3p object of residuals after removing trend #' @import dplyr #' @importFrom x3ptools df_to_x3p #' @importFrom stats lm predict diff --git a/R/vec_align_sigs_list.R b/R/vec_align_sigs_list.R index 7dff318..19d92d2 100644 --- a/R/vec_align_sigs_list.R +++ b/R/vec_align_sigs_list.R @@ -9,6 +9,7 @@ #' @param name2 name for the second cut #' @param legendname legend name #' @param titlename title name +#' @return list of aligned signals named \code{ccf}, \code{lag} and \code{lands} followed the output format of \code{bulletxtrctr::sig_align} #' @importFrom ggplot2 ggplot aes geom_line labs xlab ggtitle #' @importFrom bulletxtrctr sig_align #' @export diff --git a/R/x3p_MLE_angle_vec.R b/R/x3p_MLE_angle_vec.R index 08285a1..33b5467 100644 --- a/R/x3p_MLE_angle_vec.R +++ b/R/x3p_MLE_angle_vec.R @@ -6,6 +6,7 @@ #' @param min_score_cut the tuning parameter for minimum scores required in hough transformation #' @param ifplot whether graphs are displayed #' @param loess_span the parameter which controls the degree of smoothing +#' @return vector of rotation angles computed by MLE procedure #' @import dplyr #' @importFrom ggplot2 ggplot geom_histogram geom_point geom_smooth #' @importFrom raster raster diff --git a/R/x3p_image_autosize.R b/R/x3p_image_autosize.R index d321b4d..5450b6f 100644 --- a/R/x3p_image_autosize.R +++ b/R/x3p_image_autosize.R @@ -5,6 +5,7 @@ #' @param ifhtml logical, whether the image will be put on html #' @param zoom numeric value indicating the amount of zoom #' @param ... other parameter values except size and zoom used in \code{x3ptools::x3p_image} +#' @return rgl plot, list of tags when \code{ifhtml = TRUE} #' @importFrom x3ptools x3p_image #' @importFrom rgl rglwidget #' @importFrom htmltools tagList diff --git a/R/x3p_impute.R b/R/x3p_impute.R index d93364d..243005a 100644 --- a/R/x3p_impute.R +++ b/R/x3p_impute.R @@ -7,6 +7,7 @@ #' @param ifsave whether the imputation procedure gif is going to be saved #' @param dir_name required when \code{ifsave} is \code{TRUE} #' @param ifplot whether graphs are displayed +#' @return x3p obeject after imputation #' @import dplyr #' @importFrom x3ptools x3p_delete_mask x3p_extract x3p_average x3p_add_mask #' @importFrom ggplot2 ggplot aes geom_raster scale_fill_gradient2 labs ggsave diff --git a/R/x3p_insidepoly_df.R b/R/x3p_insidepoly_df.R index 606d70a..b9681bf 100644 --- a/R/x3p_insidepoly_df.R +++ b/R/x3p_insidepoly_df.R @@ -4,6 +4,7 @@ #' @param x3p x3p object #' @param mask_col colour for the polygon #' @param concavity strictly positive value used in \code{concaveman::concaveman} +#' @return data frame of inside polygon #' @import dplyr #' @importFrom x3ptools x3p_extract x3p_average x3p_to_df #' @importFrom tidyr pivot_longer diff --git a/R/x3p_quantile_angle_vec.R b/R/x3p_quantile_angle_vec.R index af3f346..8353d15 100644 --- a/R/x3p_quantile_angle_vec.R +++ b/R/x3p_quantile_angle_vec.R @@ -5,6 +5,7 @@ #' @param ntheta number of bins along theta used in \code{imager::hough_line} #' @param min_score_cut the tuning parameter for minimum scores required in hough transformation #' @param ifplot whether graphs are displayed +#' @return vector of rotation angles computed by quantile procedure #' @import dplyr #' @importFrom ggplot2 ggplot aes geom_histogram geom_point #' @importFrom raster raster diff --git a/R/x3p_raw_sig_vec.R b/R/x3p_raw_sig_vec.R index 02f5528..9d63316 100644 --- a/R/x3p_raw_sig_vec.R +++ b/R/x3p_raw_sig_vec.R @@ -4,6 +4,7 @@ #' @param x3p x3p object #' @param method choice of \code{median} or \code{mean} when computing the summary statistics #' @param ifplot whether graphs are displayed +#' @return vector of raw signal extracted #' @import dplyr #' @importFrom x3ptools x3p_to_df #' @importFrom ggplot2 ggplot aes geom_line diff --git a/R/x3p_shift_sig_vec.R b/R/x3p_shift_sig_vec.R index 921cd1e..93d0585 100644 --- a/R/x3p_shift_sig_vec.R +++ b/R/x3p_shift_sig_vec.R @@ -5,6 +5,7 @@ #' @param method choice of \code{median} or \code{mean} when computing the summary statistics #' @param ifplot whether graphs are displayed #' @param delta shifting range when minimizing MSE +#' @return vector of shifted signals #' @import dplyr #' @importFrom x3ptools x3p_to_df x3p_delete_mask x3p_bin_stripes #' @importFrom ggplot2 ggplot aes geom_line geom_point diff --git a/R/x3p_vertical.R b/R/x3p_vertical.R index 21e0c27..b0d7194 100644 --- a/R/x3p_vertical.R +++ b/R/x3p_vertical.R @@ -8,6 +8,7 @@ #' @param min_score_cut the tuning parameter for minimum scores required in hough transformation #' @param ifplot whether graphs are displayed #' @param loess_span the parameter which controls the degree of smoothing, only available when \code{method = MLE} +#' @return x3p object after rotation with vertical striations #' @import dplyr #' @importFrom x3ptools x3p_bin_stripes x3p_extract x3p_rotate #' @export diff --git a/man/df_rmtrend_x3p.Rd b/man/df_rmtrend_x3p.Rd index 7cba740..2f2754b 100644 --- a/man/df_rmtrend_x3p.Rd +++ b/man/df_rmtrend_x3p.Rd @@ -13,6 +13,9 @@ df_rmtrend_x3p(x3p, mask_col = "#FF0000", concavity = 1.5) \item{concavity}{strictly positive value used in \code{concaveman::concaveman}} } +\value{ +x3p object of residuals after removing trend +} \description{ Obtained x3p object after removing missing values and the quadratic trend from the inner polygon. } diff --git a/man/vec_align_sigs_list.Rd b/man/vec_align_sigs_list.Rd index 22cfcec..db0b1c0 100644 --- a/man/vec_align_sigs_list.Rd +++ b/man/vec_align_sigs_list.Rd @@ -32,6 +32,9 @@ vec_align_sigs_list( \item{titlename}{title name} } +\value{ +list of aligned signals named \code{ccf}, \code{lag} and \code{lands} followed the output format of \code{bulletxtrctr::sig_align} +} \description{ Align signals with plot. } diff --git a/man/x3p_MLE_angle_vec.Rd b/man/x3p_MLE_angle_vec.Rd index 666173f..db07fee 100644 --- a/man/x3p_MLE_angle_vec.Rd +++ b/man/x3p_MLE_angle_vec.Rd @@ -23,6 +23,9 @@ x3p_MLE_angle_vec( \item{loess_span}{the parameter which controls the degree of smoothing} } +\value{ +vector of rotation angles computed by MLE procedure +} \description{ Compute the rotation angle using MLE with hough transformation. } diff --git a/man/x3p_image_autosize.Rd b/man/x3p_image_autosize.Rd index 99ea6ad..29e05f3 100644 --- a/man/x3p_image_autosize.Rd +++ b/man/x3p_image_autosize.Rd @@ -15,6 +15,9 @@ x3p_image_autosize(x3p, ifhtml = FALSE, zoom = 0.6, ...) \item{...}{other parameter values except size and zoom used in \code{x3ptools::x3p_image}} } +\value{ +rgl plot, list of tags when \code{ifhtml = TRUE} +} \description{ Plot x3p object as an image with auto-adjusted size based on \code{x3ptools::x3p_image}. } diff --git a/man/x3p_impute.Rd b/man/x3p_impute.Rd index b1c4bbd..31ac550 100644 --- a/man/x3p_impute.Rd +++ b/man/x3p_impute.Rd @@ -26,6 +26,9 @@ x3p_impute( \item{ifplot}{whether graphs are displayed} } +\value{ +x3p obeject after imputation +} \description{ Obtained x3p object after imputing the inner polygon. } diff --git a/man/x3p_insidepoly_df.Rd b/man/x3p_insidepoly_df.Rd index 28b5f0f..c884a68 100644 --- a/man/x3p_insidepoly_df.Rd +++ b/man/x3p_insidepoly_df.Rd @@ -13,6 +13,9 @@ x3p_insidepoly_df(x3p, mask_col = "#FF0000", concavity = 1.5) \item{concavity}{strictly positive value used in \code{concaveman::concaveman}} } +\value{ +data frame of inside polygon +} \description{ Create the summary data frame for the inner polygon of an x3p object. } diff --git a/man/x3p_quantile_angle_vec.Rd b/man/x3p_quantile_angle_vec.Rd index b8193cc..aed95c0 100644 --- a/man/x3p_quantile_angle_vec.Rd +++ b/man/x3p_quantile_angle_vec.Rd @@ -15,6 +15,9 @@ x3p_quantile_angle_vec(x3p, ntheta = 720, min_score_cut = 2, ifplot = FALSE) \item{ifplot}{whether graphs are displayed} } +\value{ +vector of rotation angles computed by quantile procedure +} \description{ Compute the rotation angle using quantile with hough transformation. } diff --git a/man/x3p_raw_sig_vec.Rd b/man/x3p_raw_sig_vec.Rd index 081eff7..cdd8523 100644 --- a/man/x3p_raw_sig_vec.Rd +++ b/man/x3p_raw_sig_vec.Rd @@ -13,6 +13,9 @@ x3p_raw_sig_vec(x3p, method = "median", ifplot = FALSE) \item{ifplot}{whether graphs are displayed} } +\value{ +vector of raw signal extracted +} \description{ Extract signal by computing summary statistics of values along y for each x with raw x3p object. } diff --git a/man/x3p_shift_sig_vec.Rd b/man/x3p_shift_sig_vec.Rd index cbc85dd..90cd3f4 100644 --- a/man/x3p_shift_sig_vec.Rd +++ b/man/x3p_shift_sig_vec.Rd @@ -15,6 +15,9 @@ x3p_shift_sig_vec(x3p, method = "median", ifplot = FALSE, delta = -5:5) \item{delta}{shifting range when minimizing MSE} } +\value{ +vector of shifted signals +} \description{ Extract signal by computing summary statistics of values along y for each x with transformed x3p object by minimizing MSE. } diff --git a/man/x3p_subsamples.Rd b/man/x3p_subsamples.Rd index aa3a5a1..4316d02 100644 --- a/man/x3p_subsamples.Rd +++ b/man/x3p_subsamples.Rd @@ -6,7 +6,7 @@ \title{Subsampled wire cuts data} \format{ list -A list of x3p objects +A list of x3p objects named with surface scan names } \usage{ x3p_subsamples diff --git a/man/x3p_vertical.Rd b/man/x3p_vertical.Rd index 8e21a5f..884c1e3 100644 --- a/man/x3p_vertical.Rd +++ b/man/x3p_vertical.Rd @@ -29,6 +29,9 @@ x3p_vertical( \item{loess_span}{the parameter which controls the degree of smoothing, only available when \code{method = MLE}} } +\value{ +x3p object after rotation with vertical striations +} \description{ Rotate imputed x3p object with striations to the vertical direction. }