Title: | Resources to Assist Novice Developers |
---|---|
Description: | Assist novice developers when preparing a single package or a set of integrated packages to submit to CRAN. Automate the following individual or batch processing: check local source packages; build local .tar.gz source files; install packages from local .tar.gz files; detect conflicts between function names in the environment. |
Authors: | Barry Zeeberg [aut, cre] |
Maintainer: | Barry Zeeberg <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.2.0 |
Built: | 2025-02-19 04:30:01 UTC |
Source: | https://github.com/cran/NoviceDeveloperResources |
check, build, and install local source package
checkBuildInstallSourcePackage(dir, packs, packCheck, autoLibrary = FALSE)
checkBuildInstallSourcePackage(dir, packs, packCheck, autoLibrary = FALSE)
dir |
character string containing the path name of the directory holding the package folders |
packs |
character vector of the names of the packages |
packCheck |
character vector of the names of the packages to check() |
autoLibrary |
Boolean if TRUE automate library() command altering search path |
I wanted to include "library(packs)" in the program, but this is not allowed. The user can "cat" the return value and copy and paste to facilitate doing this manually.
returns a list whose components are
character string that can be printed using "echo" and then copy and paste by the user to load or update the packages
return value of dateTable()
## Not run: # you need to specify dir, packs that are on your own computer !! dir1<-"~/personal/hearts/hearts_card_game_bayesian_inference" dir2<-"packages/inference_packages/inference_packages/" packs<-c("cardUtils","clickableImageMap") l<-checkBuildInstallSourcePackage(sprintf("%s/%s",dir1,dir2),packs,packs,TRUE) ## End(Not run)
## Not run: # you need to specify dir, packs that are on your own computer !! dir1<-"~/personal/hearts/hearts_card_game_bayesian_inference" dir2<-"packages/inference_packages/inference_packages/" packs<-c("cardUtils","clickableImageMap") l<-checkBuildInstallSourcePackage(sprintf("%s/%s",dir1,dir2),packs,packs,TRUE) ## End(Not run)
determine if there are any conflicts between the functions in the attached packages and the R global environment
conflictOfInterest()
conflictOfInterest()
returns a list identifying the conflicts for each conflicted function
l<-conflictOfInterest()
l<-conflictOfInterest()
restrict the conflicted functions (retrieved by conflictOfInterest()) to those in user-specified packages
conflictOfInterestRestricted(packs)
conflictOfInterestRestricted(packs)
packs |
character vector of user-specified packages |
returns a subset of the return value of conflictOfInterest()
## Not run: # you need to specify packs that are on your own computer !! pack<-c("retrieve","tcpflow") conflictOfInterestRestricted(pack) ## End(Not run)
## Not run: # you need to specify packs that are on your own computer !! pack<-c("retrieve","tcpflow") conflictOfInterestRestricted(pack) ## End(Not run)
list of file dates
dateTable(dt, f, when)
dateTable(dt, f, when)
dt |
date table in list format |
f |
character string containing the full path name of the file |
when |
character string either "before" or "after" |
allows the user to confirm that the .tar.gz and the library packages are not left-overs
updated version of dt
## Not run: # you need to specify dir, f that is on your own computer !! dt<-list() dir<-"~/personal/hearts/hearts_card_game_bayesian_inference/packages" f<-sprintf("%s/%s",dir,"NoviceDeveloperResources_1.1.0.tar.gz") when<-"before" dateTable(dt,f,when) ## End(Not run)
## Not run: # you need to specify dir, f that is on your own computer !! dt<-list() dir<-"~/personal/hearts/hearts_card_game_bayesian_inference/packages" f<-sprintf("%s/%s",dir,"NoviceDeveloperResources_1.1.0.tar.gz") when<-"before" dateTable(dt,f,when) ## End(Not run)
check for newly created file existence and age
fExistsAge(f)
fExistsAge(f)
f |
character string containing the path name of the file |
returns no values,but has side effect of terminating if file is not valid
## Not run: # you need to specify f that is on your own computer !! dir1<-"/Users/barryzeeberg/personal/hearts" dir2<-"hearts_card_game_bayesian_inference/packages" f<-"NoviceDeveloperResources_1.1.0.tar.gz" fExistsAge(sprintf("%s/%s/%s",dir1,dir2,f)) ## End(Not run)
## Not run: # you need to specify f that is on your own computer !! dir1<-"/Users/barryzeeberg/personal/hearts" dir2<-"hearts_card_game_bayesian_inference/packages" f<-"NoviceDeveloperResources_1.1.0.tar.gz" fExistsAge(sprintf("%s/%s/%s",dir1,dir2,f)) ## End(Not run)
given a package name, reformat it as listed in the search path
formatSearchPack(pack)
formatSearchPack(pack)
pack |
list of character strings containing the names of a package |
returns list of package names formatted it as listed in the search path
pack<-c("retrieve","tcpflow") formatSearchPack(pack)
pack<-c("retrieve","tcpflow") formatSearchPack(pack)
For consistency, make sure that we are always using the designated library rather than a random library
getSysLib()
getSysLib()
returns a character string containing the path name for the designated library
if(interactive()) { sysLib<-getSysLib() }
if(interactive()) { sysLib<-getSysLib() }
is the package listed in the search path
inSearchPath(pack)
inSearchPath(pack)
pack |
list of character strings containing the name of a package |
returns list of Booleans TRUE if the package is listed in the search path
## Not run: # you need to specify packs that are on your own computer !! pack<-c("retrieve","tcpflow") inSearchPath(pack) ## End(Not run)
## Not run: # you need to specify packs that are on your own computer !! pack<-c("retrieve","tcpflow") inSearchPath(pack) ## End(Not run)
detach old version of package from search path, load new version, and validate
zload(lib, pack, dt)
zload(lib, pack, dt)
lib |
character string containing the name of the user-designated library |
pack |
character string containing the name of a package |
dt |
date table in list format |
returns updated version of date table
## Not run: # you need to specify packs that are on your own computer !! lib<-getSysLib() dt<-list() zload(lib,"NoviceDeveloperResources",dt) ## End(Not run)
## Not run: # you need to specify packs that are on your own computer !! lib<-getSysLib() dt<-list() zload(lib,"NoviceDeveloperResources",dt) ## End(Not run)