R/convert_to_SharedData.R

Defines functions convert_to_SharedData

Documented in convert_to_SharedData

#' Convert a data frame to a SharedData object and warn the user
#'   this was done
#'
#' Helper function for internal use only.
#' @param df The provided data object to be converted to a SharedData object.
#' @returns A SharedData object.
#' @importFrom crosstalk SharedData is.SharedData
#' @keywords internal
convert_to_SharedData <- function(df) {
  if (isFALSE(is.SharedData(df))) {
    warning("Converted `shareddata` to a SharedData object.",
      call. = FALSE
    )
    df <- SharedData$new(df)
  }
  df
}

Try the DrivePlotR package in your browser

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

DrivePlotR documentation built on Nov. 22, 2026, 5:06 p.m.