[Stacomir-commits] r168 - in pkg/stacomirtools: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Aug 20 15:43:05 CEST 2016
Author: briand
Date: 2016-08-20 15:43:05 +0200 (Sat, 20 Aug 2016)
New Revision: 168
Added:
pkg/stacomirtools/R/stacomirtools.r
pkg/stacomirtools/man/funout.Rd
Removed:
pkg/stacomirtools/R/stacomirtools.R
pkg/stacomirtools/inst/
Modified:
pkg/stacomirtools/DESCRIPTION
pkg/stacomirtools/NAMESPACE
pkg/stacomirtools/R/RequeteODBC.r
pkg/stacomirtools/R/utilitaires.r
Log:
Modified: pkg/stacomirtools/DESCRIPTION
===================================================================
--- pkg/stacomirtools/DESCRIPTION 2016-08-20 12:56:22 UTC (rev 167)
+++ pkg/stacomirtools/DESCRIPTION 2016-08-20 13:43:05 UTC (rev 168)
@@ -1,6 +1,6 @@
Package: stacomirtools
Type: Package
-Title: stacomi ODBC connection class
+Title: ODBC connection class for package stacomiR
Version: 0.5.0
Date: 2013-01-07
Author: Cedric Briand
@@ -15,4 +15,5 @@
'utilitaires.r'
'stacomirtools.r'
LazyLoad: yes
-Imports: methods,RODBC,xtable,utils
\ No newline at end of file
+Depends:RODBC
+Imports: methods,xtable,utils
\ No newline at end of file
Modified: pkg/stacomirtools/NAMESPACE
===================================================================
--- pkg/stacomirtools/NAMESPACE 2016-08-20 12:56:22 UTC (rev 167)
+++ pkg/stacomirtools/NAMESPACE 2016-08-20 13:43:05 UTC (rev 168)
@@ -13,4 +13,5 @@
export(induk)
export(ex)
export(funhtml)
-importFrom("methods", "as", "slot", "slot<-","new")
\ No newline at end of file
+importFrom("methods", "as", "slot", "slot<-","new")
+import("RODBC")
\ No newline at end of file
Modified: pkg/stacomirtools/R/RequeteODBC.r
===================================================================
--- pkg/stacomirtools/R/RequeteODBC.r 2016-08-20 12:56:22 UTC (rev 167)
+++ pkg/stacomirtools/R/RequeteODBC.r 2016-08-20 13:43:05 UTC (rev 168)
@@ -114,6 +114,7 @@
}
if (!object at silent) funout(msg5) # query trial
if (verbose) print(object at sql)
+ query<-data.frame() # otherwise, query called in the later expression is evaluated as a global variable by RCheck
e=expression(query<-sqlQuery(object at connection,object at sql,errors=TRUE))
if (object at open) {
# If we want to leave the connection open no finally clause
Deleted: pkg/stacomirtools/R/stacomirtools.R
===================================================================
--- pkg/stacomirtools/R/stacomirtools.R 2016-08-20 12:56:22 UTC (rev 167)
+++ pkg/stacomirtools/R/stacomirtools.R 2016-08-20 13:43:05 UTC (rev 168)
@@ -1,4 +0,0 @@
-# this is to be able to use the package outside from stacomir
-utils::globalVariables("envir_stacomi","funout")
-
-
Copied: pkg/stacomirtools/R/stacomirtools.r (from rev 167, pkg/stacomirtools/R/stacomirtools.R)
===================================================================
--- pkg/stacomirtools/R/stacomirtools.r (rev 0)
+++ pkg/stacomirtools/R/stacomirtools.r 2016-08-20 13:43:05 UTC (rev 168)
@@ -0,0 +1,4 @@
+# this is to be able to use the package outside from stacomir
+utils::globalVariables("envir_stacomi")
+
+
Modified: pkg/stacomirtools/R/utilitaires.r
===================================================================
--- pkg/stacomirtools/R/utilitaires.r 2016-08-20 12:56:22 UTC (rev 167)
+++ pkg/stacomirtools/R/utilitaires.r 2016-08-20 13:43:05 UTC (rev 168)
@@ -129,11 +129,20 @@
#' @param tab
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @export
-tab2df=function(tab){
+tab2df<-function(tab){
if (length((attributes(tab)$dim))>2) stop("only works with tables of dim 2")
df=as.data.frame(matrix(as.vector(tab),nrow(tab),ncol(tab)))
rownames(df)<-attributes(tab)$row.vars[[1]]
colnames(df)<-attributes(tab)$col.vars[[1]]
return(df)
}
-
+#' Function loaded in this package to avoid errors, if the package is called without stacomiR
+#' @param text The text to display
+#' @param arret Boolean should the program stop
+#' @param wash= FALSE only used when called from within stacomiR, and there is a widget interface,
+#' kept there for consistency
+#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+#' @export
+funout<-function(text,arret=FALSE,wash=FALSE){
+ if(arret) stop(text) else print(text,quote=FALSE)
+}
\ No newline at end of file
Added: pkg/stacomirtools/man/funout.Rd
===================================================================
--- pkg/stacomirtools/man/funout.Rd (rev 0)
+++ pkg/stacomirtools/man/funout.Rd 2016-08-20 13:43:05 UTC (rev 168)
@@ -0,0 +1,21 @@
+\name{funout}
+\alias{funout}
+\title{Function loaded in this package to avoid errors, if the package is called without stacomiR}
+\usage{
+ funout(text,arret=FALSE,wash=FALSE)
+}
+\arguments{
+ \item{text}{The text to display}
+ \item{arret}{If true calls the program to stop and the message to be displayed}
+ \item{wash}{Only used when called from within stacomiR, and there is a widget interface, kept there for consistency }
+}
+\description{
+ This function will be replaced by a longer function using gWidgets if the package stacomiR is loaded. It
+ is provided there to avoid to pointing to an undefined global function. Normally the program tests for the existence of
+ and environment envir_stacomi which indicates that the messages are to be displayed in the gWidget interface, so this code
+ is to avoid notes in R.check.
+}
+\author{
+ Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+}
+
More information about the Stacomir-commits
mailing list