[Ruler-commits] r30 - / pkg pkg/ruleR/R pkg/ruleR/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 1 23:20:10 CEST 2012


Author: merysionek
Date: 2012-08-01 23:20:10 +0200 (Wed, 01 Aug 2012)
New Revision: 30

Added:
   pkg/ruleR/man/texput.log
   plot.default.Rd
Modified:
   pkg/New.R
   pkg/ruleR/R/ruleR.R
   pkg/ruleR/man/AddConstSingleRule-class.Rd
Log:
createSR and print function corrected

Modified: pkg/New.R
===================================================================
--- pkg/New.R	2012-08-01 16:29:33 UTC (rev 29)
+++ pkg/New.R	2012-08-01 21:20:10 UTC (rev 30)
@@ -315,13 +315,12 @@
       if("constantVal"%in%slotNames(singleRules[[a1]])){m<-new(singleRules[[a1]],constantVal=cv1)} else{m<-new(singleRules[[a1]])}
       
       if(n!=0) {k<-createSR(p[[1]],p[[2]],n-1,p[-c(1,2)]); m at previousRule<-k
-      }else{return(m)}
+      }#else{return(m)}
   
       return(m)                                                     
                                                 }
 
 
-
 # A FUNCTION TO COMBINE DOUBLE RULES - it generates all parameters automatically 
 
 # 'a' is index from a list of DoubleRules
@@ -526,7 +525,7 @@
                                                 }
                                 pr(x)
                                 
-                                if(!class(x at previousRule)=="SingleRule"){x<-x at previousRule; pr(x)}
+                                if(class(x at previousRule)!="SingleRule"){x<-x at previousRule; print(x)}
                                 
                               }
 

Modified: pkg/ruleR/R/ruleR.R
===================================================================
--- pkg/ruleR/R/ruleR.R	2012-08-01 16:29:33 UTC (rev 29)
+++ pkg/ruleR/R/ruleR.R	2012-08-01 21:20:10 UTC (rev 30)
@@ -238,32 +238,26 @@
 # '...' if I would like to add some rules nested I can provide their parameters cv must be always supplied #9even if the function doesn't require that
 
 createSR<-function(a1=NULL,cv1=NULL,n=NULL,...){
-      p<-list(...)#arguments for nesting other functions
-      p<-unlist(p)
-      
-      #if(!is.null(n) && length(p)!=2*n) stop (paste("parameters of functions to be nested do not match n=",n))
-      #for(i in seq(1,length(p),by=2)){if(k[i]>length(p)) stop (paste("List of rules is shorter than ",k[i]))}
-      
-      if(is.null(a1)) {a1<-sample(2:length(singleRules),1)} #generate 'a' if no is supplied (we don't want to generate a=1 because it is identical function)
-      if(is.null(cv1)) {cv1<-sample(1:100,1)} # generate a constant value if no is supplied
-      if(is.null(n)){n<-sample(c(0,1,2),1,prob=c(3/6,2/6,1/6)) #nesting more than two rules would be impossible to guess
-                     p<-as.vector(matrix(replicate(n,c(sample(1:length(singleRules),1),sample(1:100,1))),1,2*n))
-                     } # generate 'n' if it is set as null with different probabilities
-      
-      print(paste("a1",a1))
-      print(paste("cv1",cv1))
-      print(paste("n",n))
-      print(p)
-      print("------------------")
-      
-      if("constantVal"%in%slotNames(singleRules[[a1]])){m<-new(singleRules[[a1]],constantVal=cv1)} else{m<-new(singleRules[[a1]])}
-      
-      
-      if(n+1!=0) {k<-createSR(p[[1]],p[[2]],n-1,p[-c(1,2)]); m at previousRule<-k
-      }else{return(m)}
+  p<-list(...)#arguments for nesting other functions
+  p<-unlist(p)
   
-      return(m)                                                     
-                                                }
+  #if(!is.null(n) && length(p)!=2*n) stop (paste("parameters of functions to be nested do not match n=",n))
+  #for(i in seq(1,length(p),by=2)){if(k[i]>length(p)) stop (paste("List of rules is shorter than ",k[i]))}
+  
+  if(is.null(a1)) {a1<-sample(2:length(singleRules),1)} #generate 'a' if no is supplied (we don't want to generate a=1 because it is identical function)
+  if(is.null(cv1)) {cv1<-sample(1:100,1)} # generate a constant value if no is supplied
+  if(is.null(n)){n<-sample(c(0,1,2),1,prob=c(3/6,2/6,1/6)) #nesting more than two rules would be impossible to guess
+                 p<-as.vector(matrix(replicate(n,c(sample(1:length(singleRules),1),sample(1:100,1))),1,2*n))
+  } # generate 'n' if it is set as null with different probabilities
+  
+  
+  if("constantVal"%in%slotNames(singleRules[[a1]])){m<-new(singleRules[[a1]],constantVal=cv1)} else{m<-new(singleRules[[a1]])}
+  
+  if(n!=0) {k<-createSR(p[[1]],p[[2]],n-1,p[-c(1,2)]); m at previousRule<-k
+  }#else{return(m)}
+  
+  return(m)                                                     
+}
 
 m<-createSR(a1=2,cv1=2,n=3,3,3,4,4,5,5)
 
@@ -448,7 +442,7 @@
                                                 }
                                 pr(x)
                                 
-                                if(!class(x at previousRule)=="SingleRule"){x<-x at previousRule; pr(x)}
+                                if(!class(x at previousRule)=="SingleRule"){x<-x at previousRule; print(x)}
                                 
                               }
 

Modified: pkg/ruleR/man/AddConstSingleRule-class.Rd
===================================================================
--- pkg/ruleR/man/AddConstSingleRule-class.Rd	2012-08-01 16:29:33 UTC (rev 29)
+++ pkg/ruleR/man/AddConstSingleRule-class.Rd	2012-08-01 21:20:10 UTC (rev 30)
@@ -39,7 +39,8 @@
 
 %% ~Make other sections like Warning with \section{Warning }{....} ~
 
-\seealso{
+\code{\link{calculate}}, \code{\linkS4class{SingleRule}}, \code{\link{print}}
+
 \code{\link{calculate}}, a functions to execute the rule
 \code{\linkS4class{SingleRule}}
 }

Added: pkg/ruleR/man/texput.log
===================================================================
--- pkg/ruleR/man/texput.log	                        (rev 0)
+++ pkg/ruleR/man/texput.log	2012-08-01 21:20:10 UTC (rev 30)
@@ -0,0 +1,19 @@
+This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2012.7.31)  31 JUL 2012 21:11
+entering extended mode
+**AddConstSingleRule-class.tex
+
+! Emergency stop.
+<*> AddConstSingleRule-class.tex
+                                
+*** (job aborted, file error in nonstop mode)
+
+ 
+Here is how much of TeX's memory you used:
+ 2 strings out of 494045
+ 34 string characters out of 3148387
+ 48890 words of memory out of 3000000
+ 3399 multiletter control sequences out of 15000+200000
+ 3640 words of font info for 14 fonts, out of 3000000 for 9000
+ 715 hyphenation exceptions out of 8191
+ 0i,0n,0p,1b,6s stack positions out of 5000i,500n,10000p,200000b,50000s
+!  ==> Fatal error occurred, no output PDF file produced!

Added: plot.default.Rd
===================================================================
--- plot.default.Rd	                        (rev 0)
+++ plot.default.Rd	2012-08-01 21:20:10 UTC (rev 30)
@@ -0,0 +1,150 @@
+\name{plot.default}
+\alias{plot.default}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+%%  ~~function to do ... ~~
+}
+\description{
+%%  ~~ A concise (1-5 lines) description of what the function does. ~~
+}
+\usage{
+plot.default(x, y = NULL, type = "p", xlim = NULL, ylim = NULL, log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL, ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL, panel.last = NULL, asp = NA, ...)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{x}{
+%%     ~~Describe \code{x} here~~
+}
+  \item{y}{
+%%     ~~Describe \code{y} here~~
+}
+  \item{type}{
+%%     ~~Describe \code{type} here~~
+}
+  \item{xlim}{
+%%     ~~Describe \code{xlim} here~~
+}
+  \item{ylim}{
+%%     ~~Describe \code{ylim} here~~
+}
+  \item{log}{
+%%     ~~Describe \code{log} here~~
+}
+  \item{main}{
+%%     ~~Describe \code{main} here~~
+}
+  \item{sub}{
+%%     ~~Describe \code{sub} here~~
+}
+  \item{xlab}{
+%%     ~~Describe \code{xlab} here~~
+}
+  \item{ylab}{
+%%     ~~Describe \code{ylab} here~~
+}
+  \item{ann}{
+%%     ~~Describe \code{ann} here~~
+}
+  \item{axes}{
+%%     ~~Describe \code{axes} here~~
+}
+  \item{frame.plot}{
+%%     ~~Describe \code{frame.plot} here~~
+}
+  \item{panel.first}{
+%%     ~~Describe \code{panel.first} here~~
+}
+  \item{panel.last}{
+%%     ~~Describe \code{panel.last} here~~
+}
+  \item{asp}{
+%%     ~~Describe \code{asp} here~~
+}
+  \item{\dots}{
+%%     ~~Describe \code{\dots} here~~
+}
+}
+\details{
+%%  ~~ If necessary, more details than the description above ~~
+}
+\value{
+%%  ~Describe the value returned
+%%  If it is a LIST, use
+%%  \item{comp1 }{Description of 'comp1'}
+%%  \item{comp2 }{Description of 'comp2'}
+%% ...
+}
+\references{
+%% ~put references to the literature/web site here ~
+}
+\author{
+%%  ~~who you are~~
+}
+\note{
+%%  ~~further notes~~
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+\seealso{
+%% ~~objects to See Also as \code{\link{help}}, ~~~
+}
+\examples{
+##---- Should be DIRECTLY executable !! ----
+##-- ==>  Define data, use random,
+##--	or do  help(data=index)  for the standard data sets.
+
+## The function is currently defined as
+function (x, y = NULL, type = "p", xlim = NULL, ylim = NULL, 
+    log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL, 
+    ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL, 
+    panel.last = NULL, asp = NA, ...) 
+{
+    localAxis <- function(..., col, bg, pch, cex, lty, lwd) Axis(...)
+    localBox <- function(..., col, bg, pch, cex, lty, lwd) box(...)
+    localWindow <- function(..., col, bg, pch, cex, lty, lwd) plot.window(...)
+    localTitle <- function(..., col, bg, pch, cex, lty, lwd) title(...)
+    xlabel <- if (!missing(x)) 
+        deparse(substitute(x))
+    ylabel <- if (!missing(y)) 
+        deparse(substitute(y))
+    xy <- xy.coords(x, y, xlabel, ylabel, log)
+    xlab <- if (is.null(xlab)) 
+        xy$xlab
+    else xlab
+    ylab <- if (is.null(ylab)) 
+        xy$ylab
+    else ylab
+    xlim <- if (is.null(xlim)) 
+        range(xy$x[is.finite(xy$x)])
+    else xlim
+    ylim <- if (is.null(ylim)) 
+        range(xy$y[is.finite(xy$y)])
+    else ylim
+    dev.hold()
+    on.exit(dev.flush())
+    plot.new()
+    localWindow(xlim, ylim, log, asp, ...)
+    panel.first
+    plot.xy(xy, type, ...)
+    panel.last
+    if (axes) {
+        localAxis(if (is.null(y)) 
+            xy$x
+        else x, side = 1, ...)
+        localAxis(if (is.null(y)) 
+            x
+        else y, side = 2, ...)
+    }
+    if (frame.plot) 
+        localBox(...)
+    if (ann) 
+        localTitle(main = main, sub = sub, xlab = xlab, ylab = ylab, 
+            ...)
+    invisible()
+  }
+}
+% Add one or more standard keywords, see file 'KEYWORDS' in the
+% R documentation directory.
+\keyword{ ~kwd1 }
+\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line



More information about the Ruler-commits mailing list