# 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')
# update namespaces in package functions
pretty_namespace(pkg_dir_R, overwrite = TRUE)
# test on one R file
# this will create a new R file called 'oxy-yy.R' in the same directory
makeOxyFile(file.path(pkg_dir_R,'yy.R'))
# Remove the file
unlink(file.path(pkg_dir_R,'oxy-yy.R'))
# Test on all R files in directory and overwrite the contents
makeOxyFile(pkg_dir_R, overwrite = TRUE)
# Remove Skeleton
rmOxygen(file.path(pkg_dir_R,'yy.R'))
rmOxygen(file.path(pkg_dir_R,'zz.R'))
# adds more fields to defaults, passes "cut" to make_import
sinew_opts$append(list(add_fields=c("concept", "describeIn")))
makeOxyFile(file.path(pkg_dir_R,'yy.R'), cut = 5)
# cleanup
unlink(pkg_dir, recursive = TRUE, force = TRUE)
sinew_opts$restore()
# }
Run the code above in your browser using DataLab