R/rename.R

Defines functions rename.morphed_tbl_graph rename.tbl_graph

#' @export
#' @importFrom dplyr rename
rename.tbl_graph <- function(.data, ...) {
  .register_graph_context(.data)
  d_tmp <- as_tibble(.data)
  d_tmp <- rename(d_tmp, ...)
  set_graph_data(.data, d_tmp)
}
#' @export
#' @importFrom dplyr rename
rename.morphed_tbl_graph <- function(.data, ...) {
  .data[] <- lapply(.data, protect_ind, .f = rename, ...)
  .data
}
#' @export
dplyr::rename

Try the tidygraph package in your browser

Any scripts or data that you put into this service are public.

tidygraph documentation built on June 22, 2024, 11:32 a.m.