[Sciviews-commits] r167 - in pkg/svTools: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 6 20:47:05 CEST 2009
Author: romain
Date: 2009-08-06 20:47:03 +0200 (Thu, 06 Aug 2009)
New Revision: 167
Added:
pkg/svTools/man/installedPackages.Rd
pkg/svTools/man/loadedPackages.Rd
Modified:
pkg/svTools/NAMESPACE
pkg/svTools/R/packages.R
Log:
added some documentation
Modified: pkg/svTools/NAMESPACE
===================================================================
--- pkg/svTools/NAMESPACE 2009-08-06 12:14:59 UTC (rev 166)
+++ pkg/svTools/NAMESPACE 2009-08-06 18:47:03 UTC (rev 167)
@@ -41,8 +41,8 @@
export( namespaceParser )
# packages.R
-export( packwebdesc )
-export( packdesc )
+# export( packwebdesc )
+# export( packdesc )
export( installedPackages )
export( loadedPackages )
Modified: pkg/svTools/R/packages.R
===================================================================
--- pkg/svTools/R/packages.R 2009-08-06 12:14:59 UTC (rev 166)
+++ pkg/svTools/R/packages.R 2009-08-06 18:47:03 UTC (rev 167)
@@ -4,8 +4,8 @@
sub("^package:", "", s )
}
-installedPackages <- function( pattern = NULL){
- ip <- installed.packages( fields = "Title" )
+installedPackages <- function( pattern = NULL, ... ){
+ ip <- installed.packages( fields = "Title", ... )
if( !is.null(pattern) ){
keep <- suppressWarnings( union(
grep( pattern , ip [,"Package"], ignore.case = TRUE ),
@@ -15,8 +15,8 @@
lp <- loadedPackages()
def <- c( getOption("defaultPackages"), "base")
ip <- cbind( ip,
- "Loaded" = ifelse( ip[,'Package'] %in% lp , 1, 0 ),
- "Default" = ifelse( ip[,'Package'] %in% def, 1, 0 )
+ "Loaded" = ip[,'Package'] %in% lp ,
+ "Default" = ip[,'Package'] %in% def
)
ip
}
@@ -61,7 +61,7 @@
readLines(file)
}
-packwebdesc <- function(pack, repos, width = 60){
+packwebdesc <- function(pack, repos){
temp <- tempfile(); on.exit(unlink(temp))
txt <- suppressWarnings( try({
download.file( sprintf("%s/Descriptions/%s.DESCRIPTION",repos,pack), destfile=temp, quiet = TRUE)
Added: pkg/svTools/man/installedPackages.Rd
===================================================================
--- pkg/svTools/man/installedPackages.Rd (rev 0)
+++ pkg/svTools/man/installedPackages.Rd 2009-08-06 18:47:03 UTC (rev 167)
@@ -0,0 +1,29 @@
+\name{installedPackages}
+\Rdversion{1.1}
+\alias{installedPackages}
+\title{
+Installed packages
+}
+\description{
+This is similar to installed.packages but with
+two additional columns indicating if the package is
+loaded and default
+}
+\usage{
+installedPackages(pattern = NULL)
+}
+\arguments{
+ \item{pattern}{filter on the name or the title of the packages}
+ \item{...}{arguments for \code{\link[utils]{installed.packages}}}
+}
+\value{
+A matrix similar to the result of \code{\link[utils]{installed.packages}}
+with two additional columns
+}
+\author{
+Romain Francois <francoisromain at free.fr>
+}
+\seealso{
+\code{\link{installed.packages}}
+}
+\keyword{ manip }
Added: pkg/svTools/man/loadedPackages.Rd
===================================================================
--- pkg/svTools/man/loadedPackages.Rd (rev 0)
+++ pkg/svTools/man/loadedPackages.Rd 2009-08-06 18:47:03 UTC (rev 167)
@@ -0,0 +1,15 @@
+\name{loadedPackages}
+\Rdversion{1.1}
+\alias{loadedPackages}
+\title{The list of loaded packages}
+\description{Simple utility that returns the list of loaded packages}
+\usage{
+loadedPackages()
+}
+\value{
+A character vector containing the list of loaded packages
+}
+\author{
+Romain Francois <francoisromain at free.fr>
+}
+\keyword{ manip }
More information about the Sciviews-commits
mailing list