[R-gregmisc-commits] r2182 - pkg/gmodels/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 20 22:40:23 CEST 2018


Author: warnes
Date: 2018-06-20 22:40:23 +0200 (Wed, 20 Jun 2018)
New Revision: 2182

Modified:
   pkg/gmodels/R/est_p_ci.R
Log:
Use base::trimws() instead of gdata::trim()

Modified: pkg/gmodels/R/est_p_ci.R
===================================================================
--- pkg/gmodels/R/est_p_ci.R	2018-06-20 20:35:54 UTC (rev 2181)
+++ pkg/gmodels/R/est_p_ci.R	2018-06-20 20:40:23 UTC (rev 2182)
@@ -7,7 +7,7 @@
   if(is.character(term) && !(term %in% rownames(info)))
     stop(term, " is not a coefficient in model.")
   info <- info[term,]
-  info.ci <- trim(format( round(mult * info[1:3], digits=digits) ))
+  info.ci <- trimws(format( round(mult * info[1:3], digits=digits) ))
   if(mult < 0)
     names(info.ci) <- rev(names(info.ci))
   paste("Est=", info.ci[1],
@@ -26,11 +26,11 @@
 {
   if( !all(c("lower CI", "upper CI") %in% colnames(model) ) )
     stop("object does not contain confidence interval information.")
-  
-  if(is.character(term) && !(term %in% rownames(info)))
+
+  if(is.character(term) && !(term %in% rownames(model)))
     stop(term, " is not a coefficient in model.")
-  
-  info.ci <- trim(format( round(mult * model[term, c("lower CI", "upper CI")], 
+
+  info.ci <- trimws(format( round(mult * model[term, c("lower CI", "upper CI")],
                            digits=digits) )  )
   if(mult < 0)
     names(info.ci) <- rev(names(info.ci))



More information about the R-gregmisc-commits mailing list