diff --git a/NAMESPACE b/NAMESPACE index 18ac9e2..ba721ec 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,8 +10,8 @@ export(create_subgrps) export(create_var_from_codelist) export(drop_unspec_vars) export(metatools_example) -export(sort_key) -export(sort_order) +export(order_cols) +export(sort_by_key) importFrom(dplyr,"%>%") importFrom(dplyr,across) importFrom(dplyr,all_of) diff --git a/R/sort.R b/R/sort.R index 3f4171f..affbcd7 100644 --- a/R/sort.R +++ b/R/sort.R @@ -21,8 +21,8 @@ #' spec <- define_to_metacore(metacore_example("ADaM_define.xml"), quiet = TRUE) %>% #' select_dataset("ADSL") #' data <- read_xpt(metatools_example("adsl.xpt")) -#' sort_order(data, spec) -sort_order <- function(data, metacore, dataset_name = NULL) { +#' order_cols(data, spec) +order_cols <- function(data, metacore, dataset_name = NULL) { metacore <- make_lone_dataset(metacore, dataset_name) var_ord <- metacore$ds_vars %>% filter(!is.na(.data$order)) %>% @@ -55,8 +55,8 @@ sort_order <- function(data, metacore, dataset_name = NULL) { #' spec <- define_to_metacore(metacore_example("ADaM_define.xml"), quiet = TRUE) %>% #' select_dataset("ADSL") #' data <- read_xpt(metatools_example("adsl.xpt")) -#' sort_key(data, spec) -sort_key <- function(data, metacore, dataset_name = NULL) { +#' sort_by_key (data, spec) +sort_by_key <- function(data, metacore, dataset_name = NULL) { metacore <- make_lone_dataset(metacore, dataset_name) var_ord <- metacore$ds_vars %>% filter(!is.na(.data$key_seq)) %>% diff --git a/man/sort_order.Rd b/man/order_cols.Rd similarity index 87% rename from man/sort_order.Rd rename to man/order_cols.Rd index b17dce8..37e68a5 100644 --- a/man/sort_order.Rd +++ b/man/order_cols.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/sort.R -\name{sort_order} -\alias{sort_order} +\name{order_cols} +\alias{order_cols} \title{Sort Columns by Order} \usage{ -sort_order(data, metacore, dataset_name = NULL) +order_cols(data, metacore, dataset_name = NULL) } \arguments{ \item{data}{Dataset to sort} @@ -29,5 +29,5 @@ library(magrittr) spec <- define_to_metacore(metacore_example("ADaM_define.xml"), quiet = TRUE) \%>\% select_dataset("ADSL") data <- read_xpt(metatools_example("adsl.xpt")) -sort_order(data, spec) +order_cols(data, spec) } diff --git a/man/sort_key.Rd b/man/sort_by_key.Rd similarity index 87% rename from man/sort_key.Rd rename to man/sort_by_key.Rd index d6c8d23..bf839bb 100644 --- a/man/sort_key.Rd +++ b/man/sort_by_key.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/sort.R -\name{sort_key} -\alias{sort_key} +\name{sort_by_key} +\alias{sort_by_key} \title{Sort Rows by Key Sequence} \usage{ -sort_key(data, metacore, dataset_name = NULL) +sort_by_key(data, metacore, dataset_name = NULL) } \arguments{ \item{data}{Dataset to sort} @@ -29,5 +29,5 @@ library(magrittr) spec <- define_to_metacore(metacore_example("ADaM_define.xml"), quiet = TRUE) \%>\% select_dataset("ADSL") data <- read_xpt(metatools_example("adsl.xpt")) -sort_key(data, spec) +sort_by_key (data, spec) }