R/check_refs_names.R

Defines functions check_refs_names

check_refs_names <- function(dl){
  ### Make sure it gets a name ####
  if(is.null(unlist(dl))) return(NULL)
  for(i in seq(length(dl))){
    nm <- names(dl[i])
    if(is.null(nm) || nm=="NULL"){
      if(methods::is(dl[[i]],"description")){
        names(dl)[i] <- dl[[i]]$get_field("Package")  
      } else if(is.character(dl[[i]])){
        names(dl)[i] <- dl[[i]]
      } 
    } 
    # else if(!is.null(names(dl[i])) && !is.null(dl[[i]]) &&
    #           basename(names(dl[i]))!=dl[[i]]$get_field("Package")){
    #   messager(
    #     "Mismatch between requested package and package name in DESCRIPTION.",
    #     "Setting entry to NULL.",v=verbose)
    #   dl[[i]] <- NULL
    # }
  } 
  return(dl)
}

Try the rworkflows package in your browser

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

rworkflows documentation built on Sept. 23, 2024, 1:08 a.m.