[Yuima-commits] r826 - in pkg/yuima: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 5 06:29:54 CET 2022


Author: iacus
Date: 2022-12-05 06:29:54 +0100 (Mon, 05 Dec 2022)
New Revision: 826

Modified:
   pkg/yuima/NEWS
   pkg/yuima/R/IC.R
Log:
fixed IC.R if(class())

Modified: pkg/yuima/NEWS
===================================================================
--- pkg/yuima/NEWS	2022-12-05 05:05:25 UTC (rev 825)
+++ pkg/yuima/NEWS	2022-12-05 05:29:54 UTC (rev 826)
@@ -127,5 +127,6 @@
 v. 1.15.18 2022/11/05
 * remove sprintf from ae.c
 * protected object in euler.c
+* changed if(class()) with inherits() in IC.R
 
 

Modified: pkg/yuima/R/IC.R
===================================================================
--- pkg/yuima/R/IC.R	2022-12-05 05:05:25 UTC (rev 825)
+++ pkg/yuima/R/IC.R	2022-12-05 05:29:54 UTC (rev 826)
@@ -370,10 +370,11 @@
           Diff.esti.bic.sub <- gsub(swbeta[[BIC.opt1]][(j+1)], Esti1.chr.bic[(j+1)], Diff.esti.bic.sub)
         }
       }
-      if(class(Diff.esti.bic) == "character"){
-        Diff.esti.bic <- Diff.esti.bic.sub
-      }else{
-        Diff.esti.bic[i,] <- Diff.esti.bic.sub
+    #  if(class(Diff.esti.bic) == "character"){
+      if(inherits(Diff.esti.bic, "character")){
+          Diff.esti.bic <- Diff.esti.bic.sub
+      } else {
+          Diff.esti.bic[i,] <- Diff.esti.bic.sub
       }
     }
     
@@ -390,9 +391,10 @@
           Diff.esti.qbic.sub <- gsub(swbeta[[QBIC.opt1]][(j+1)], Esti1.chr.qbic[(j+1)], Diff.esti.qbic.sub)
         }
       }
-      if(class(Diff.esti.qbic) == "character"){
+      #if(class(Diff.esti.qbic) == "character"){
+      if(inherits(Diff.esti.qbic,"character")){
         Diff.esti.qbic <- Diff.esti.qbic.sub
-      }else{
+      } else {
         Diff.esti.qbic[i,] <- Diff.esti.qbic.sub
       }
     }
@@ -410,9 +412,10 @@
           Diff.esti.aic.sub <- gsub(swbeta[[AIC.opt1]][(j+1)], Esti1.chr.aic[(j+1)], Diff.esti.aic.sub)
         }
       }
-      if(class(Diff.esti.aic) == "character"){
+      #if(class(Diff.esti.aic) == "character"){
+      if(inherits(Diff.esti.aic, "character")){
         Diff.esti.aic <- Diff.esti.aic.sub
-      }else{
+      } else {
         Diff.esti.aic[i,] <- Diff.esti.aic.sub
       }
     }
@@ -529,9 +532,10 @@
               Diff.esti.sub <- gsub(swbeta[[i]][(k+1)], Esti1.chr[(k+1)], Diff.esti.sub)
             }
           }
-          if(class(Diff.esti) == "character"){
+          #if(class(Diff.esti) == "character"){
+          if(inherits(Diff.esti, "character")){
             Diff.esti <- Diff.esti.sub
-          }else{
+          } else {
             Diff.esti[j,] <- Diff.esti.sub
           }
         }



More information about the Yuima-commits mailing list