[Distr-commits] r724 - branches/distr-2.4/pkg/distr/R pkg/distr pkg/distr/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 22 21:44:30 CET 2011


Author: ruckdeschel
Date: 2011-03-22 21:44:29 +0100 (Tue, 22 Mar 2011)
New Revision: 724

Modified:
   branches/distr-2.4/pkg/distr/R/print-show-methods.R
   pkg/distr/DESCRIPTION
   pkg/distr/R/print-show-methods.R
Log:
fixed an error in show method for UnivarLebDecDistribution: match.call() threw an error; compare mail by B. Ripley and to/from J Chambers

Modified: branches/distr-2.4/pkg/distr/R/print-show-methods.R
===================================================================
--- branches/distr-2.4/pkg/distr/R/print-show-methods.R	2011-02-15 09:32:41 UTC (rev 723)
+++ branches/distr-2.4/pkg/distr/R/print-show-methods.R	2011-03-22 20:44:29 UTC (rev 724)
@@ -141,9 +141,12 @@
 
 setMethod("show", "UnivarLebDecDistribution",
           function(object){
-           objs <- as.character(deparse(           
-           match.call(
-                   call = sys.call(sys.parent(1)))$object))
+           sc <- sys.call(sys.parent(1))
+           if(identical(sc[[1]], as.name("show"))){
+              objs <- as.character(deparse(match.call(call = sc)$object))
+           }else{
+              objs <- "<obj>"
+           }
             cls <- class(object)[1]
             cat(showobj(object, className = cls, objs = objs))
            ws <- .IssueWarn(object at .withArith, object at .withSim)          
@@ -153,8 +156,8 @@
 
 setMethod("showobj", "UnivarLebDecDistribution",
           function(object, className = class(object)[1], objs){
-              if(missing(objs)) objs <- "" 
-              else if(length(grep("<S4 object ", objs))) objs <- ""
+              if(missing(objs)) objs <- "<obj>" 
+              else if(length(grep("<S4 object ", objs))) objs <- "<obj>"
               txt <- gettextf("An object of class \"%s\"\n", className)
               txt <- c(txt,
                        gettextf("--- a Lebesgue decomposed distribution:\n\n"))

Modified: pkg/distr/DESCRIPTION
===================================================================
--- pkg/distr/DESCRIPTION	2011-02-15 09:32:41 UTC (rev 723)
+++ pkg/distr/DESCRIPTION	2011-03-22 20:44:29 UTC (rev 724)
@@ -1,6 +1,6 @@
 Package: distr
-Version: 2.3.1
-Date: 2011-01-14
+Version: 2.3.2
+Date: 2011-03-22
 Title: Object oriented implementation of distributions
 Description: S4 Classes and Methods for distributions
 Author: Florian Camphausen, Matthias Kohl, Peter Ruckdeschel, Thomas Stabla
@@ -14,4 +14,4 @@
 URL: http://distr.r-forge.r-project.org/
 LastChangedDate: {$LastChangedDate$}
 LastChangedRevision: {$LastChangedRevision$}
-SVNRevision: 699
+SVNRevision: 723

Modified: pkg/distr/R/print-show-methods.R
===================================================================
--- pkg/distr/R/print-show-methods.R	2011-02-15 09:32:41 UTC (rev 723)
+++ pkg/distr/R/print-show-methods.R	2011-03-22 20:44:29 UTC (rev 724)
@@ -141,9 +141,12 @@
 
 setMethod("show", "UnivarLebDecDistribution",
           function(object){
-           objs <- as.character(deparse(           
-           match.call(
-                   call = sys.call(sys.parent(1)))$object))
+           sc <- sys.call(sys.parent(1))
+           if(identical(sc[[1]], as.name("show"))){
+              objs <- as.character(deparse(match.call(call = sc)$object))
+           }else{
+              objs <- "<obj>"
+           }
             cls <- class(object)[1]
             cat(showobj(object, className = cls, objs = objs))
            ws <- .IssueWarn(object at .withArith, object at .withSim)          
@@ -153,8 +156,8 @@
 
 setMethod("showobj", "UnivarLebDecDistribution",
           function(object, className = class(object)[1], objs){
-              if(missing(objs)) objs <- "" 
-              else if(length(grep("<S4 object ", objs))) objs <- ""
+              if(missing(objs)) objs <- "<obj>" 
+              else if(length(grep("<S4 object ", objs))) objs <- "<obj>"
               txt <- gettextf("An object of class \"%s\"\n", className)
               txt <- c(txt,
                        gettextf("--- a Lebesgue decomposed distribution:\n\n"))



More information about the Distr-commits mailing list