[Forensim-help] r126 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 23 19:36:13 CEST 2009


Author: hindahaned
Date: 2009-07-23 19:36:13 +0200 (Thu, 23 Jul 2009)
New Revision: 126

Modified:
   pkg/R/AuxFunc.R
   pkg/R/LR.R
   pkg/R/PE.R
   pkg/R/RMP.R
   pkg/R/simufreqD.R
   pkg/R/simupopD.R
Log:


Modified: pkg/R/AuxFunc.R
===================================================================
--- pkg/R/AuxFunc.R	2009-07-23 17:36:04 UTC (rev 125)
+++ pkg/R/AuxFunc.R	2009-07-23 17:36:13 UTC (rev 126)
@@ -19,12 +19,13 @@
 	maxval<-(vec[xmax])
 	}
 	#print(round(xmax))
+	
 	res0[1,1]<-xmax
-	res0[1,2]<-maxval
+	res0[1,2]<-signif(maxval,2)
 	
 	colnames(res0)<-c('max','maxval')
 	rownames(res0)<-names(vec)
-	return((res0))
+	return(res0)
 }
 
 

Modified: pkg/R/LR.R
===================================================================
--- pkg/R/LR.R	2009-07-23 17:36:04 UTC (rev 125)
+++ pkg/R/LR.R	2009-07-23 17:36:13 UTC (rev 126)
@@ -5,7 +5,7 @@
 {
 	LR1 <- Pevid2(stain=stain, freq=freq, x=xp, T=Tp, V=Vp, theta = 0 )
 	LR2 <- Pevid2(stain=stain, freq=freq, x=xd, T=Td, V=Vd,theta = 0 )
-	LR <- LR1/LR2
+	LR <- signif(LR1/LR2,4)
 	return(LR)
   
 }

Modified: pkg/R/PE.R
===================================================================
--- pkg/R/PE.R	2009-07-23 17:36:04 UTC (rev 125)
+++ pkg/R/PE.R	2009-07-23 17:36:13 UTC (rev 126)
@@ -43,14 +43,14 @@
 		
 		if(byloc)
 		{
-			return(pe.loc)
+			return(signif(pe.loc,4))
 		}
 		
 		else
 		{
 			PE <- 1-prod(1-pe.loc)
 			names(PE) <- "PE"
-			return(PE)
+			return(signif(PE,6))
 		}
 	}
 	if(theta!=0)
@@ -75,7 +75,7 @@
 		{
 			PE <- 1-prod(1-pe.loc)
 			names(PE) <- "PE"
-			return(PE)
+			return(signif(PE,6))
 		}
 	}
 }

Modified: pkg/R/RMP.R
===================================================================
--- pkg/R/RMP.R	2009-07-23 17:36:04 UTC (rev 125)
+++ pkg/R/RMP.R	2009-07-23 17:36:13 UTC (rev 126)
@@ -109,8 +109,8 @@
 	names(res) <-locus
     final <-vector('list',2)
 	names(final) <- c('RMP.loc','RMP')
-	final$RMP.loc <-unlist(res)
-	final$RMP <- prod(unlist(res))
+	final$RMP.loc <-signif(unlist(res),2)
+	final$RMP <- signif(prod(unlist(res)),2)
 	return(final)
 	
 }

Modified: pkg/R/simufreqD.R
===================================================================
--- pkg/R/simufreqD.R	2009-07-23 17:36:04 UTC (rev 125)
+++ pkg/R/simufreqD.R	2009-07-23 17:36:13 UTC (rev 126)
@@ -133,5 +133,5 @@
 	p <- cbind(as.factor(1:maxna), p)		
 	colnames(p) <- c('Allele', paste('Marker',1:nloc,sep=''))
 	rownames(p) <- 1:maxna
-	return(p)
+	return(signif(p,2))
 }
\ No newline at end of file

Modified: pkg/R/simupopD.R
===================================================================
--- pkg/R/simupopD.R	2009-07-23 17:36:04 UTC (rev 125)
+++ pkg/R/simupopD.R	2009-07-23 17:36:13 UTC (rev 126)
@@ -68,7 +68,7 @@
 
 					}
 					
-					mat[,i]<-(temp1)
+					mat[,i]<-signif(temp1,4)
 				}	
 			Allele <- rownames(mat)
 			
@@ -117,7 +117,7 @@
 				temp1 <- rdirichlet(1, varp)
 				temp1 <- as.vector(temp1)
 				names(temp1)<-locA
-				listemp[[j]]<-unlist(temp1)
+				listemp[[j]]<-signif(unlist(temp1),4)
 			}
 			#print(listemp)
 			tab[[i]]<- listemp



More information about the Forensim-commits mailing list