# NOT RUN {
# 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)
# }
Run the code above in your browser using DataLab