From 4e3b7671a0eb1d0ec16f997b62d0444d84247a6b Mon Sep 17 00:00:00 2001 From: MarcinKosinski Date: Sun, 7 Feb 2016 22:52:25 +0100 Subject: [PATCH] shorten examples in delete and create #198 #210 --- NAMESPACE | 4 +- R/createEmptyRepo.R | 43 ++------- R/deleteRepo.R | 136 ++-------------------------- man/Repository.Rd | 2 +- man/Tags.Rd | 2 +- man/addHooksToPrint.Rd | 2 +- man/addTagsRepo.Rd | 2 +- man/aformat.Rd | 2 +- man/ahistory.Rd | 2 +- man/alink.Rd | 2 +- man/archivist-package.Rd | 2 +- man/archivistOptions.Rd | 2 +- man/aread.Rd | 2 +- man/asearch.Rd | 2 +- man/asession.Rd | 2 +- man/cache.Rd | 2 +- man/copyToRepo.Rd | 2 +- man/createEmptyRepo.Rd | 45 +--------- man/createMDGallery.Rd | 2 +- man/deleteLocalRepo.Rd | 66 ++++++++++++++ man/deleteRepo.Rd | 185 --------------------------------------- man/getRemoteHook.Rd | 2 +- man/getTags.Rd | 4 +- man/loadFromRepo.Rd | 2 +- man/magrittr.Rd | 2 +- man/md5hash.Rd | 2 +- man/rmFromRepo.Rd | 2 +- man/saveToRepo.Rd | 22 ++--- man/searchInRepo.Rd | 2 +- man/setRepo.Rd | 4 +- man/shinySearchInRepo.Rd | 2 +- man/showRepo.Rd | 2 +- man/splitTags.Rd | 2 +- man/summaryRepo.Rd | 2 +- man/zipRepo.Rd | 4 +- 35 files changed, 127 insertions(+), 436 deletions(-) create mode 100644 man/deleteLocalRepo.Rd delete mode 100644 man/deleteRepo.Rd diff --git a/NAMESPACE b/NAMESPACE index d076946..4b82d13 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -18,11 +18,9 @@ export(asession) export(cache) export(copyLocalRepo) export(copyRemoteRepo) -export(createEmptyLocalRepo) -export(createEmptyRepo) +export(createLocalRepo) export(createMDGallery) export(deleteLocalRepo) -export(deleteRepo) export(getRemoteHook) export(getTagsLocal) export(getTagsRemote) diff --git a/R/createEmptyRepo.R b/R/createEmptyRepo.R index 4c91cbb..7c3f626 100644 --- a/R/createEmptyRepo.R +++ b/R/createEmptyRepo.R @@ -3,9 +3,7 @@ #' @title Create an Empty Repository #' #' @description -#' \code{createEmptyLocalRepo} creates an empty \link{Repository} in the given directory in which archived artifacts will be stored. -#' \code{createEmptyRepo} is a wrapper around \code{createEmptyLocalRepo} to maintain consistency with the previous \pkg{archivist} versions (<1.8.6.0) -#' where there was only \code{createEmptyRepo} which created Local \code{Repository}. +#' \code{createLocalRepo} creates an empty \link{Repository} in the given directory in which archived artifacts will be stored. #' #' @details #' At least one Repository must be initialized before using other functions from the \pkg{archivist} package. @@ -47,39 +45,16 @@ #' @examples #' \dontrun{ #' exampleRepoDir <- tempfile() -#' createEmptyRepo( repoDir = exampleRepoDir ) -#' -#' # check the state of an empty Repository -#' -#' summaryLocalRepo( repoDir = exampleRepoDir ) -#' showLocalRepo( exampleRepoDir ) -#' -#' # creating a Repository in non existing directory -#' -#' createEmptyLocalRepo( "xyzdd234") # force = TRUE is default argument -#' -#' # creating a default local Repository in non existing directory -#' -#' createEmptyRepo("def", default = TRUE) +#' createEmptyRepo( repoDir = exampleRepoDir, default = TRUE ) #' data(iris) -#' saveToRepo(iris) # We don't have to specify repoDir parameter -#' showLocalRepo() # because repoDir="def" is default -#' -#' # removing an example Repositories -#' -#' deleteRepo( exampleRepoDir, TRUE) -#' deleteRepo( "xyzdd234", TRUE) -#' deleteRepo("def", TRUE) -#' -#' rm( exampleRepoDir ) -#' -#' -#' } +#' saveToRepo(iris) +#' showLocalRepo() +#' showLocalRepo(method = "tags") +#' deleteLocalRepo( repoDir = exampleRepoDir, unset = TRUE, deleteRoot = TRUE) #' @family archivist - #' @rdname createEmptyRepo #' @export -createEmptyLocalRepo <- function( repoDir, force = TRUE, default = FALSE ){ +createLocalRepo <- function( repoDir, force = TRUE, default = FALSE ){ stopifnot( is.character( repoDir ), length( repoDir ) == 1 ) stopifnot( is.logical( default ), length( default ) == 1 ) @@ -128,10 +103,6 @@ createEmptyLocalRepo <- function( repoDir, force = TRUE, default = FALSE ){ } -#' @rdname createEmptyRepo -#' @export -createEmptyRepo <- createEmptyLocalRepo - addArtifact <- function( md5hash, name, dir ){ # creates connection and driver # send insert diff --git a/R/deleteRepo.R b/R/deleteRepo.R index a97cedc..e8d1ada 100644 --- a/R/deleteRepo.R +++ b/R/deleteRepo.R @@ -3,7 +3,7 @@ #' @title Delete the Existing Repository from the Given Directory #' #' @description -#' \code{deleteRepo} deletes the existing \link{Repository} from the given directory. +#' \code{deleteLocalRepo} deletes the existing \link{Repository} from the given directory. #' As a result all artifacts from \code{gallery} folder are removed and database \code{backpack.db} #' is deleted. #' @@ -14,16 +14,10 @@ #' @param unset A logical. If deleted \code{repoDir/repo} was set to be default Local/GitHub Repository #' and \code{unset} is TRUE, then \code{repoDir/repo} is unset as a default Local/GitHub Repository (\code{aoptions('repoDir/repo', NULL, T)}). #' -#' @details -#' -#' Since version 1.9 \code{deleteRepo} is a wrapper around \code{deleteLocalRepo} (in earlier versions deleteRepo) and \link[archivist.github]{deleteGitHubRepo} -#' functions and by default triggers \code{deleteLocalRepo} to maintain consistency with the previous \pkg{archivist} versions (<1.9.0) -#' where there was only \code{deleteRepo} which deleted local \code{Repository}. -#' #' @note #' Remember that using \code{tempfile()} instead of \code{tempdir()} #' in examples section is crucial. \code{tempdir()} is existing directory -#' in which R works so calling \code{deleteRepo(exampleRepoDir, deleteRoot=TRUE)} +#' in which R works so calling \code{deleteLocalRepo(exampleRepoDir, deleteRoot=TRUE)} #' removes important R files. You can find out more information about this problem at #' \href{http://stackoverflow.com/questions/22325820/unlink-function-causing-an-error-for-consequent-and-plot-functions}{stackoverflow} #' webpage. @@ -32,127 +26,15 @@ #' Marcin Kosinski, \email{m.p.kosinski@@gmail.com} #' #' @examples -#' \dontrun{ -#' -#' ######################## -#' #### Local version #### -#' ######################## -#' -#' # objects preparation -#' # data.frame object -#' data(iris) -#' -#' # ggplot/gg object -#' library(ggplot2) -#' df <- data.frame(gp = factor(rep(letters[1:3], each = 10)),y = rnorm(30)) -#' library(plyr) -#' ds <- ddply(df, .(gp), summarise, mean = mean(y), sd = sd(y)) -#' myplot123 <- ggplot(df, aes(x = gp, y = y)) + -#' geom_point() + geom_point(data = ds, aes(y = mean), -#' colour = 'red', size = 3) -#' -#' # lm object -#' model <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris) -#' -#' # agnes (twins) object -#' library(cluster) -#' data(votes.repub) -#' agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE) -#' -#' # fanny (partition) object -#' x <- rbind(cbind(rnorm(10, 0, 0.5), rnorm(10, 0, 0.5)), -#' cbind(rnorm(15, 5, 0.5), rnorm(15, 5, 0.5)), -#' cbind(rnorm( 3,3.2,0.5), rnorm( 3,3.2,0.5))) -#' fannyx <- fanny(x, 2) -#' -#' # lda object -#' library(MASS) -#' -#' Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), -#' Sp = rep(c("s","c","v"), rep(50,3))) -#' train <- c(8,83,115,118,146,82,76,9,70,139,85,59,78,143,68, -#' 134,148,12,141,101,144,114,41,95,61,128,2,42,37, -#' 29,77,20,44,98,74,32,27,11,49,52,111,55,48,33,38, -#' 113,126,24,104,3,66,81,31,39,26,123,18,108,73,50, -#' 56,54,65,135,84,112,131,60,102,14,120,117,53,138,5) -#' lda1 <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train) -#' -#' # qda object -#' tr <- c(7,38,47,43,20,37,44,22,46,49,50,19,4,32,12,29,27,34,2,1,17,13,3,35,36) -#' train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3]) -#' cl <- factor(c(rep("s",25), rep("c",25), rep("v",25))) -#' qda1 <- qda(train, cl) -#' -#' # glmnet object -#' library( glmnet ) -#' -#' zk=matrix(rnorm(100*20),100,20) -#' bk=rnorm(100) -#' glmnet1=glmnet(zk,bk) -#' -#' -#' # creating example Repository - on which examples will work -#' -#' # save examples #' #' exampleRepoDir <- tempfile() -#' createEmptyRepo( repoDir = exampleRepoDir ) -#' saveToRepo( myplot123, repoDir=exampleRepoDir ) -#' saveToRepo( iris, repoDir=exampleRepoDir ) -#' saveToRepo( model, repoDir=exampleRepoDir ) -#' saveToRepo( agn1, repoDir=exampleRepoDir ) -#' saveToRepo( fannyx, repoDir=exampleRepoDir ) -#' saveToRepo( lda1, repoDir=exampleRepoDir ) -#' saveToRepo( qda1, repoDir=exampleRepoDir ) -#' saveToRepo( glmnet1, repoDir=exampleRepoDir ) -#' -#' -#' # let's see how the Repository looks like: show -#' -#' showLocalRepo( method = "md5hashes", repoDir = exampleRepoDir ) -#' showLocalRepo( method = "tags", repoDir = exampleRepoDir ) -#' -#' # let's get information about that Repository -#' -#' summaryLocalRepo( repoDir = exampleRepoDir ) -#' -#' # now let's delete the Repository without it's root -#' -#' deleteRepo( repoDir = exampleRepoDir) -#' -#' rm( exampleRepoDir ) -#' -#' ## Using deleteRoot = TRUE argument -#' -#' # First we create default Repository on our computer -#' createEmptyRepo( repoDir = "defRepo", force = TRUE, default = TRUE ) -#' saveToRepo( myplot123) -#' saveToRepo( iris) -#' saveToRepo( model) -#' -#' # Let's see how the Repository looks like: show -#' -#' showLocalRepo( method = "md5hashes") -#' showLocalRepo( method = "tags") -#' -#' # Let's get information about that Repository -#' -#' summaryLocalRepo() -#' -#' # Now let's delete the Repository and it's root folder by using -#' # deleteRoot = TRUE argument -#' -#' deleteRepo(repoDir = "defRepo", deleteRoot = TRUE) -#' # defRepo was completely deleted indeed! We may notice it on our computer. -#' # -#' # or if aoptions('repodir') == repodir then -#' # deleteRepo(repoDir, deleteRoot = TRUE, unset = TRUE) -#' -#' } +#' createEmptyRepo( repoDir = exampleRepoDir, default = TRUE ) +#' data(iris) +#' saveToRepo(iris) +#' deleteLocalRepo( repoDir = exampleRepoDir, unset = TRUE, deleteRoot = TRUE) #' #' @family archivist - -#' @rdname deleteRepo +#' @rdname deleteLocalRepo #' @export deleteLocalRepo <- function(repoDir, deleteRoot = FALSE, unset = FALSE){ stopifnot( is.character( repoDir ), length( repoDir ) == 1 ) @@ -178,7 +60,3 @@ deleteLocalRepo <- function(repoDir, deleteRoot = FALSE, unset = FALSE){ } -#' @rdname deleteRepo -#' @export -deleteRepo <- deleteLocalRepo - diff --git a/man/Repository.Rd b/man/Repository.Rd index fa9a873..71a3441 100644 --- a/man/Repository.Rd +++ b/man/Repository.Rd @@ -90,7 +90,7 @@ Other archivist: \code{\link{Tags}}, \code{\link{\%a\%}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/Tags.Rd b/man/Tags.Rd index 8ce53d6..6fa8bea 100644 --- a/man/Tags.Rd +++ b/man/Tags.Rd @@ -402,7 +402,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/addHooksToPrint.Rd b/man/addHooksToPrint.Rd index 224ddf9..7ce6f46 100644 --- a/man/addHooksToPrint.Rd +++ b/man/addHooksToPrint.Rd @@ -46,7 +46,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/addTagsRepo.Rd b/man/addTagsRepo.Rd index 65786c6..182996c 100644 --- a/man/addTagsRepo.Rd +++ b/man/addTagsRepo.Rd @@ -102,7 +102,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/aformat.Rd b/man/aformat.Rd index dd81208..59f9252 100644 --- a/man/aformat.Rd +++ b/man/aformat.Rd @@ -43,7 +43,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/ahistory.Rd b/man/ahistory.Rd index a0b7cd6..de87a61 100644 --- a/man/ahistory.Rd +++ b/man/ahistory.Rd @@ -80,7 +80,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/alink.Rd b/man/alink.Rd index e4d3f6b..aa8eaed 100644 --- a/man/alink.Rd +++ b/man/alink.Rd @@ -94,7 +94,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/archivist-package.Rd b/man/archivist-package.Rd index 27f0157..dad6777 100644 --- a/man/archivist-package.Rd +++ b/man/archivist-package.Rd @@ -40,7 +40,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/archivistOptions.Rd b/man/archivistOptions.Rd index 025444a..97d2c02 100644 --- a/man/archivistOptions.Rd +++ b/man/archivistOptions.Rd @@ -116,7 +116,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/aread.Rd b/man/aread.Rd index 87020ad..219607c 100644 --- a/man/aread.Rd +++ b/man/aread.Rd @@ -51,7 +51,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/asearch.Rd b/man/asearch.Rd index fe0681d..9fdbe7a 100644 --- a/man/asearch.Rd +++ b/man/asearch.Rd @@ -116,7 +116,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/asession.Rd b/man/asession.Rd index bb18f03..0c92e16 100644 --- a/man/asession.Rd +++ b/man/asession.Rd @@ -43,7 +43,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/cache.Rd b/man/cache.Rd index 458ec2e..8859857 100644 --- a/man/cache.Rd +++ b/man/cache.Rd @@ -95,7 +95,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/copyToRepo.Rd b/man/copyToRepo.Rd index 4916bd4..35b311d 100644 --- a/man/copyToRepo.Rd +++ b/man/copyToRepo.Rd @@ -153,7 +153,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{alink}}, \code{\link{aoptions}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, - \code{\link{cache}}, \code{\link{createEmptyLocalRepo}}, + \code{\link{cache}}, \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/createEmptyRepo.Rd b/man/createEmptyRepo.Rd index 2e7f5b6..223349a 100644 --- a/man/createEmptyRepo.Rd +++ b/man/createEmptyRepo.Rd @@ -1,13 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/createEmptyRepo.R -\name{createEmptyLocalRepo} -\alias{createEmptyLocalRepo} -\alias{createEmptyRepo} +\name{createLocalRepo} +\alias{createLocalRepo} \title{Create an Empty Repository} \usage{ -createEmptyLocalRepo(repoDir, force = TRUE, default = FALSE) - -createEmptyRepo(repoDir, force = TRUE, default = FALSE) +createLocalRepo(repoDir, force = TRUE, default = FALSE) } \arguments{ \item{repoDir}{A character that specifies the directory for the Repository which is to be made. While working with GitHub Repository, this will @@ -21,9 +18,7 @@ Default set to \code{force = TRUE}.} (for GitHub version also the \code{user} is set as default GitHub user).} } \description{ -\code{createEmptyLocalRepo} creates an empty \link{Repository} in the given directory in which archived artifacts will be stored. -\code{createEmptyRepo} is a wrapper around \code{createEmptyLocalRepo} to maintain consistency with the previous \pkg{archivist} versions (<1.8.6.0) - where there was only \code{createEmptyRepo} which created Local \code{Repository}. +\code{createLocalRepo} creates an empty \link{Repository} in the given directory in which archived artifacts will be stored. } \details{ At least one Repository must be initialized before using other functions from the \pkg{archivist} package. @@ -48,38 +43,6 @@ artifacts will be archived. After every \code{saveToRepo} call the database is refreshed. As a result, the artifact is available immediately in \code{backpack.db} database for other collaborators. } -\examples{ -\dontrun{ -exampleRepoDir <- tempfile() -createEmptyRepo( repoDir = exampleRepoDir ) - -# check the state of an empty Repository - -summaryLocalRepo( repoDir = exampleRepoDir ) -showLocalRepo( exampleRepoDir ) - -# creating a Repository in non existing directory - -createEmptyLocalRepo( "xyzdd234") # force = TRUE is default argument - -# creating a default local Repository in non existing directory - -createEmptyRepo("def", default = TRUE) -data(iris) -saveToRepo(iris) # We don't have to specify repoDir parameter -showLocalRepo() # because repoDir="def" is default - - # removing an example Repositories - -deleteRepo( exampleRepoDir, TRUE) -deleteRepo( "xyzdd234", TRUE) -deleteRepo("def", TRUE) - -rm( exampleRepoDir ) - - -} -} \author{ Marcin Kosinski, \email{m.p.kosinski@gmail.com} } diff --git a/man/createMDGallery.Rd b/man/createMDGallery.Rd index 0d82647..4051c4d 100644 --- a/man/createMDGallery.Rd +++ b/man/createMDGallery.Rd @@ -68,7 +68,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, \code{\link{loadFromLocalRepo}}, \code{\link{md5hash}}, diff --git a/man/deleteLocalRepo.Rd b/man/deleteLocalRepo.Rd new file mode 100644 index 0000000..515f677 --- /dev/null +++ b/man/deleteLocalRepo.Rd @@ -0,0 +1,66 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/deleteRepo.R +\name{deleteLocalRepo} +\alias{deleteLocalRepo} +\title{Delete the Existing Repository from the Given Directory} +\usage{ +deleteLocalRepo(repoDir, deleteRoot = FALSE, unset = FALSE) +} +\arguments{ +\item{repoDir}{A character that specifies the directory for the Repository +which is to be deleted.} + +\item{deleteRoot}{A logical value that specifies if the repository root directory +should be deleted for Local Repository or for GitHub whether to delete whole GitHub-Repository.} + +\item{unset}{A logical. If deleted \code{repoDir/repo} was set to be default Local/GitHub Repository +and \code{unset} is TRUE, then \code{repoDir/repo} is unset as a default Local/GitHub Repository (\code{aoptions('repoDir/repo', NULL, T)}).} +} +\description{ +\code{deleteLocalRepo} deletes the existing \link{Repository} from the given directory. +As a result all artifacts from \code{gallery} folder are removed and database \code{backpack.db} +is deleted. +} +\note{ +Remember that using \code{tempfile()} instead of \code{tempdir()} +in examples section is crucial. \code{tempdir()} is existing directory +in which R works so calling \code{deleteLocalRepo(exampleRepoDir, deleteRoot=TRUE)} +removes important R files. You can find out more information about this problem at +\href{http://stackoverflow.com/questions/22325820/unlink-function-causing-an-error-for-consequent-and-plot-functions}{stackoverflow} +webpage. +} +\examples{ + +exampleRepoDir <- tempfile() +createEmptyRepo( repoDir = exampleRepoDir, default = TRUE ) +data(iris) +saveToRepo(iris) +deleteLocalRepo( repoDir = exampleRepoDir, unset = TRUE, deleteRoot = TRUE) + +} +\author{ +Marcin Kosinski, \email{m.p.kosinski@gmail.com} +} +\seealso{ +Other archivist: \code{\link{Repository}}, + \code{\link{Tags}}, \code{\link{\%a\%}}, + \code{\link{addHooksToPrint}}, \code{\link{addTagsRepo}}, + \code{\link{aformat}}, \code{\link{ahistory}}, + \code{\link{alink}}, \code{\link{aoptions}}, + \code{\link{archivist-package}}, \code{\link{aread}}, + \code{\link{asearch}}, \code{\link{asession}}, + \code{\link{cache}}, \code{\link{copyLocalRepo}}, + \code{\link{createLocalRepo}}, + \code{\link{createMDGallery}}, + \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, + \code{\link{loadFromLocalRepo}}, \code{\link{md5hash}}, + \code{\link{rmFromRepo}}, \code{\link{saveToRepo}}, + \code{\link{searchInLocalRepo}}, + \code{\link{setLocalRepo}}, + \code{\link{shinySearchInLocalRepo}}, + \code{\link{showLocalRepo}}, + \code{\link{splitTagsLocal}}, + \code{\link{summaryLocalRepo}}, + \code{\link{zipLocalRepo}} +} + diff --git a/man/deleteRepo.Rd b/man/deleteRepo.Rd deleted file mode 100644 index 0e23854..0000000 --- a/man/deleteRepo.Rd +++ /dev/null @@ -1,185 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/deleteRepo.R -\name{deleteLocalRepo} -\alias{deleteLocalRepo} -\alias{deleteRepo} -\title{Delete the Existing Repository from the Given Directory} -\usage{ -deleteLocalRepo(repoDir, deleteRoot = FALSE, unset = FALSE) - -deleteRepo(repoDir, deleteRoot = FALSE, unset = FALSE) -} -\arguments{ -\item{repoDir}{A character that specifies the directory for the Repository -which is to be deleted.} - -\item{deleteRoot}{A logical value that specifies if the repository root directory -should be deleted for Local Repository or for GitHub whether to delete whole GitHub-Repository.} - -\item{unset}{A logical. If deleted \code{repoDir/repo} was set to be default Local/GitHub Repository -and \code{unset} is TRUE, then \code{repoDir/repo} is unset as a default Local/GitHub Repository (\code{aoptions('repoDir/repo', NULL, T)}).} -} -\description{ -\code{deleteRepo} deletes the existing \link{Repository} from the given directory. -As a result all artifacts from \code{gallery} folder are removed and database \code{backpack.db} -is deleted. -} -\details{ -Since version 1.9 \code{deleteRepo} is a wrapper around \code{deleteLocalRepo} (in earlier versions deleteRepo) and \link[archivist.github]{deleteGitHubRepo} - functions and by default triggers \code{deleteLocalRepo} to maintain consistency with the previous \pkg{archivist} versions (<1.9.0) - where there was only \code{deleteRepo} which deleted local \code{Repository}. -} -\note{ -Remember that using \code{tempfile()} instead of \code{tempdir()} -in examples section is crucial. \code{tempdir()} is existing directory -in which R works so calling \code{deleteRepo(exampleRepoDir, deleteRoot=TRUE)} -removes important R files. You can find out more information about this problem at -\href{http://stackoverflow.com/questions/22325820/unlink-function-causing-an-error-for-consequent-and-plot-functions}{stackoverflow} -webpage. -} -\examples{ -\dontrun{ - -######################## -#### Local version #### -######################## - -# objects preparation -# data.frame object -data(iris) - -# ggplot/gg object -library(ggplot2) -df <- data.frame(gp = factor(rep(letters[1:3], each = 10)),y = rnorm(30)) -library(plyr) -ds <- ddply(df, .(gp), summarise, mean = mean(y), sd = sd(y)) -myplot123 <- ggplot(df, aes(x = gp, y = y)) + - geom_point() + geom_point(data = ds, aes(y = mean), - colour = 'red', size = 3) - -# lm object -model <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris) - -# agnes (twins) object -library(cluster) -data(votes.repub) -agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE) - -# fanny (partition) object -x <- rbind(cbind(rnorm(10, 0, 0.5), rnorm(10, 0, 0.5)), - cbind(rnorm(15, 5, 0.5), rnorm(15, 5, 0.5)), - cbind(rnorm( 3,3.2,0.5), rnorm( 3,3.2,0.5))) -fannyx <- fanny(x, 2) - -# lda object -library(MASS) - -Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), - Sp = rep(c("s","c","v"), rep(50,3))) -train <- c(8,83,115,118,146,82,76,9,70,139,85,59,78,143,68, - 134,148,12,141,101,144,114,41,95,61,128,2,42,37, - 29,77,20,44,98,74,32,27,11,49,52,111,55,48,33,38, - 113,126,24,104,3,66,81,31,39,26,123,18,108,73,50, - 56,54,65,135,84,112,131,60,102,14,120,117,53,138,5) -lda1 <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train) - -# qda object -tr <- c(7,38,47,43,20,37,44,22,46,49,50,19,4,32,12,29,27,34,2,1,17,13,3,35,36) -train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3]) -cl <- factor(c(rep("s",25), rep("c",25), rep("v",25))) -qda1 <- qda(train, cl) - -# glmnet object -library( glmnet ) - -zk=matrix(rnorm(100*20),100,20) -bk=rnorm(100) -glmnet1=glmnet(zk,bk) - - -# creating example Repository - on which examples will work - -# save examples - -exampleRepoDir <- tempfile() -createEmptyRepo( repoDir = exampleRepoDir ) -saveToRepo( myplot123, repoDir=exampleRepoDir ) -saveToRepo( iris, repoDir=exampleRepoDir ) -saveToRepo( model, repoDir=exampleRepoDir ) -saveToRepo( agn1, repoDir=exampleRepoDir ) -saveToRepo( fannyx, repoDir=exampleRepoDir ) -saveToRepo( lda1, repoDir=exampleRepoDir ) -saveToRepo( qda1, repoDir=exampleRepoDir ) -saveToRepo( glmnet1, repoDir=exampleRepoDir ) - - -# let's see how the Repository looks like: show - -showLocalRepo( method = "md5hashes", repoDir = exampleRepoDir ) -showLocalRepo( method = "tags", repoDir = exampleRepoDir ) - -# let's get information about that Repository - -summaryLocalRepo( repoDir = exampleRepoDir ) - -# now let's delete the Repository without it's root - -deleteRepo( repoDir = exampleRepoDir) - -rm( exampleRepoDir ) - -## Using deleteRoot = TRUE argument - -# First we create default Repository on our computer -createEmptyRepo( repoDir = "defRepo", force = TRUE, default = TRUE ) -saveToRepo( myplot123) -saveToRepo( iris) -saveToRepo( model) - -# Let's see how the Repository looks like: show - -showLocalRepo( method = "md5hashes") -showLocalRepo( method = "tags") - -# Let's get information about that Repository - -summaryLocalRepo() - -# Now let's delete the Repository and it's root folder by using -# deleteRoot = TRUE argument - -deleteRepo(repoDir = "defRepo", deleteRoot = TRUE) -# defRepo was completely deleted indeed! We may notice it on our computer. -# -# or if aoptions('repodir') == repodir then -# deleteRepo(repoDir, deleteRoot = TRUE, unset = TRUE) - -} - -} -\author{ -Marcin Kosinski, \email{m.p.kosinski@gmail.com} -} -\seealso{ -Other archivist: \code{\link{Repository}}, - \code{\link{Tags}}, \code{\link{\%a\%}}, - \code{\link{addHooksToPrint}}, \code{\link{addTagsRepo}}, - \code{\link{aformat}}, \code{\link{ahistory}}, - \code{\link{alink}}, \code{\link{aoptions}}, - \code{\link{archivist-package}}, \code{\link{aread}}, - \code{\link{asearch}}, \code{\link{asession}}, - \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, - \code{\link{createMDGallery}}, - \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, - \code{\link{loadFromLocalRepo}}, \code{\link{md5hash}}, - \code{\link{rmFromRepo}}, \code{\link{saveToRepo}}, - \code{\link{searchInLocalRepo}}, - \code{\link{setLocalRepo}}, - \code{\link{shinySearchInLocalRepo}}, - \code{\link{showLocalRepo}}, - \code{\link{splitTagsLocal}}, - \code{\link{summaryLocalRepo}}, - \code{\link{zipLocalRepo}} -} - diff --git a/man/getRemoteHook.Rd b/man/getRemoteHook.Rd index 574922d..d971aad 100644 --- a/man/getRemoteHook.Rd +++ b/man/getRemoteHook.Rd @@ -45,7 +45,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getTagsLocal}}, diff --git a/man/getTags.Rd b/man/getTags.Rd index 6744522..89a3e20 100644 --- a/man/getTags.Rd +++ b/man/getTags.Rd @@ -145,7 +145,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, @@ -167,7 +167,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, diff --git a/man/loadFromRepo.Rd b/man/loadFromRepo.Rd index 34fa3a4..b6c3fb7 100644 --- a/man/loadFromRepo.Rd +++ b/man/loadFromRepo.Rd @@ -268,7 +268,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/magrittr.Rd b/man/magrittr.Rd index 5c3b07c..b3fe87e 100644 --- a/man/magrittr.Rd +++ b/man/magrittr.Rd @@ -68,7 +68,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/md5hash.Rd b/man/md5hash.Rd index cbe30ab..e74fa29 100644 --- a/man/md5hash.Rd +++ b/man/md5hash.Rd @@ -60,7 +60,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/rmFromRepo.Rd b/man/rmFromRepo.Rd index de94bd5..ebea3e2 100644 --- a/man/rmFromRepo.Rd +++ b/man/rmFromRepo.Rd @@ -326,7 +326,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/saveToRepo.Rd b/man/saveToRepo.Rd index f4bdcc4..97def77 100644 --- a/man/saveToRepo.Rd +++ b/man/saveToRepo.Rd @@ -142,24 +142,24 @@ Example: The data set will be archived here. } } \examples{ -\dontrun{ exampleRepoDir <- tempfile() -createEmptyRepo( repoDir = exampleRepoDir ) +createEmptyRepo(repoDir = exampleRepoDir) data(iris) -saveToRepo( iris, repoDir=exampleRepoDir, archiveSessionInfo = TRUE ) -showLocalRepo( method = "md5hashes", repoDir = exampleRepoDir ) -showLocalRepo( method = "tags", repoDir = exampleRepoDir ) +saveToRepo(iris, repoDir=exampleRepoDir, archiveSessionInfo = TRUE) +showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir) +showLocalRepo(method = "tags", repoDir = exampleRepoDir) loadFromLocalRepo(md5hash = '600bda83cb840947976bd1ce3a11879d', repoDir = system.file("graphGallery", package = "archivist"), value = TRUE) -> pl -saveToRepo( pl, repoDir=exampleRepoDir, - userTags = c( "do not delete", "my favourite graph" ) ) +saveToRepo(pl, repoDir=exampleRepoDir, + userTags = c("do not delete", "my favourite graph")) aoptions('repoDir', system.file("graphGallery", package = "archivist")) -showLocalRepo( method = "tags" ) +showLocalRepo(method = "tags") aoptions('repoDir', NULL, unset = TRUE) -deleteRepo( exampleRepoDir, TRUE) -} +deleteRepo(exampleRepoDir, TRUE) +rm(exampleRepoDir) + } \author{ Marcin Kosinski , \email{m.p.kosinski@gmail.com} @@ -178,7 +178,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/searchInRepo.Rd b/man/searchInRepo.Rd index 9279a8d..f24af2f 100644 --- a/man/searchInRepo.Rd +++ b/man/searchInRepo.Rd @@ -215,7 +215,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/setRepo.Rd b/man/setRepo.Rd index 950127c..c5be5a9 100644 --- a/man/setRepo.Rd +++ b/man/setRepo.Rd @@ -128,7 +128,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, @@ -149,7 +149,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/shinySearchInRepo.Rd b/man/shinySearchInRepo.Rd index 8a05b6c..9dbc811 100644 --- a/man/shinySearchInRepo.Rd +++ b/man/shinySearchInRepo.Rd @@ -63,7 +63,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/showRepo.Rd b/man/showRepo.Rd index e9f6e3c..1ef2326 100644 --- a/man/showRepo.Rd +++ b/man/showRepo.Rd @@ -211,7 +211,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/splitTags.Rd b/man/splitTags.Rd index 160c20c..7a3f0e5 100644 --- a/man/splitTags.Rd +++ b/man/splitTags.Rd @@ -105,7 +105,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/summaryRepo.Rd b/man/summaryRepo.Rd index 6e00e40..9a6b703 100644 --- a/man/summaryRepo.Rd +++ b/man/summaryRepo.Rd @@ -153,7 +153,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, diff --git a/man/zipRepo.Rd b/man/zipRepo.Rd index d72705c..f2e4ada 100644 --- a/man/zipRepo.Rd +++ b/man/zipRepo.Rd @@ -110,7 +110,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}}, @@ -131,7 +131,7 @@ Other archivist: \code{\link{Repository}}, \code{\link{archivist-package}}, \code{\link{aread}}, \code{\link{asearch}}, \code{\link{asession}}, \code{\link{cache}}, \code{\link{copyLocalRepo}}, - \code{\link{createEmptyLocalRepo}}, + \code{\link{createLocalRepo}}, \code{\link{createMDGallery}}, \code{\link{deleteLocalRepo}}, \code{\link{getRemoteHook}}, \code{\link{getTagsLocal}},