update_desc {sinew}R Documentation

Update Package Description File

Description

Update package DESCRIPTION file Imports field

Usage

update_desc(path, overwrite = TRUE)

Arguments

path

character, path to R folder containing package functions

overwrite

logical, overwrite the file, Default: TRUE

Details

If overwrite is FALSE then the output will be returned to the console.

Author(s)

Jonathan Sidi

Examples


# copy dummy package to tempdir
file.copy(system.file('pkg',package = 'sinew'),tempdir(),recursive = TRUE)

pkg_dir <- file.path(tempdir(),'pkg')
pkg_dir_R <- file.path(pkg_dir,'R')
pkg_dir_DESC <- file.path(pkg_dir,'DESCRIPTION')

# update namespaces in package functions
pretty_namespace(pkg_dir_R,overwrite = TRUE)

# send result to the console
update_desc(pkg_dir_R,overwrite = FALSE)

# overwrite the Imports field
update_desc(pkg_dir_R,overwrite = TRUE)

# view DESCRIPTION file
cat(readLines(pkg_dir_DESC),sep='\n')

# cleanup tempdir
unlink(pkg_dir,recursive = TRUE,force = TRUE)


[Package sinew version 0.4.0 Index]