R/d_compact.R

Defines functions d_compact

Documented in d_compact

#' @title Compact a data base
#'
#' @author P. Chevallier - Jan 2019
#'
#' @description Compact htsr sqlite data base
#'
#' @param fsq Full name of the data base

#' @return
#' New data base or overwritten data base. Note that the created data base is empty.
#'

d_compact <- function(fsq) {

  # Creation
  if(!file.exists(fsq)== TRUE)
    return (warning ("The base ",fsq, " doesn't exist."))
  d_backup(fsq)
  conn <- dbConnect(SQLite(), fsq)
  dbExecute(conn, "VACUUM")
  dbDisconnect(conn)
  message ("\nBase ",fsq, " compacted.")
}

Try the htsr package in your browser

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

htsr documentation built on Oct. 13, 2023, 5:10 p.m.