Skip to content

Commit

Permalink
Merge pull request #114 from spsanderson/development
Browse files Browse the repository at this point in the history
Fixes #113
  • Loading branch information
spsanderson authored Sep 27, 2024
2 parents 7edf7db + 2ca6fc4 commit a3a0eb5
Show file tree
Hide file tree
Showing 12 changed files with 92 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export(discrete_walk)
export(euclidean_distance)
export(generate_caption)
export(geometric_brownian_motion)
export(get_attributes)
export(kurtosis_vec)
export(rand_walk_helper)
export(random_normal_drift_walk)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ minimum of a random walk.
maximum of a random walk.
5. Fix #96 - Add Function `std_cum_mean_augment()` to calculate the cumulative
mean of a random walk.
6. Fix #113 - Add Function `get_attributes()` to get attributes without the `row.names`

## Minor Improvements and Fixes
None
Expand Down
39 changes: 39 additions & 0 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -515,3 +515,42 @@ std_cum_mean_augment <- function(.data,

return(ret)
}

#' Get Attributes
#'
#' @family Utility Functions
#'
#' @author Steven P. Sanderson II, MPH
#'
#' @details This function retrieves the attributes of a given R object,
#' excluding the row.names attribute.
#'
#' @description The `get_attributes` function takes an R object as input and
#' returns its attributes, omitting the row.names attribute.
#'
#' @param .data An R object from which attributes are to be extracted.
#'
#' @examples
#' get_attributes(rw30())
#' get_attributes(iris)
#' get_attributes(mtcars)
#'
#' @return A list of attributes of the input R object, excluding row.names.
#'
#' @name get_attributes
NULL
#'
#' @rdname get_attributes
#'
#' @export

get_attributes <- function(.data){

atb <- attributes(.data)

# drop row.names
atb <- atb[!names(atb) %in% c("row.names")]

# Return
return(atb)
}
1 change: 1 addition & 0 deletions man/convert_snake_to_title_case.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/generate_caption.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions man/get_attributes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/rand_walk_helper.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/std_cum_max_augment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/std_cum_mean_augment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/std_cum_min_augment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/std_cum_prod_augment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/std_cum_sum_augment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a3a0eb5

Please sign in to comment.