Hi All,
I am facing a strange problem.  I am making a R Package that internally run
various packages and summarizes the results from them.
I am getting this error from the piece of code written below. The text in
red color is throwing
Error in `[.matrix.coo`(x, rw, cl) : Subscripts out of bound
Value of m is 99
This code works fine when I tested it. But money I make  library it gives me
error.
I have attached the file names messages.txt which contains the
warnings/messages generated while making R package.
I am out of ideas
Kindly suggest something

regards
vidhu
############################################################################
`sm.quantreg` <-
function(y, lambda = 1.0, tau = 0.5, interpolate = FALSE)  {
  nona <- !is.na(y)

  ## Sparse matrices: E, D, and B
  if(!interpolate)  {
    y.nona <- y[nona]
    m <- length(y.nona)  *1.0
    E <- as.matrix.csr(0,m,m)
    diag(E) <- 1
*    D <- diff(E)*
    B <- rbind(E, lambda * D)
   ystar <- c(y.nona, rep(0,m-1))

  }else  {
    ## interpolate missing values via weighting
    y[!nona] <- 0
    m <- length(y) *1.0
    E <- as.matrix.csr(0,m,m)

    diag(E) <- 1
    D <- diff(E)
    tmp <- as.matrix.csr(0,m,m)
    diag(tmp) <- as.numeric(nona)
    B <- rbind(tmp, lambda * D)
    ystar <- c(y, rep(0,m-1))
  }

  ## use sparse matrices and accompanying mathematical operations
  cat ("before try\n")
  try(myrq <- rq.fit.sfn(as.matrix.csr(B), ystar, tau))
  cat ("after try\n")
  if(exists("myrq"))  {
    if(!interpolate)  {
      ys <- rep(NA, length(y))
      ys[nona] <- myrq$coef
    }else  {
      ys <- myrq$coef
    }
  }else  {
    cat("Error triggered within Quantreg algorithm!\n")
    ys <- NULL
  }
  return(ys)
}

##########################
C:\Documents and Settings\Administrator\My Documents>R CMD INSTALL t1
installing to 'c:/R/R-2.6.2/library'


---------- Making package t1 ------------
  adding build stamp to DESCRIPTION
  installing NAMESPACE file and metadata
  making DLL ...
gcc-sjlj  -std=gnu99  -IC:/R/R-2.6.2/include     -O3 -Wall  -c CGHseg_rewrite.c
-o CGHseg_rewrite.o
gcc-sjlj  -std=gnu99  -IC:/R/R-2.6.2/include     -O3 -Wall  -c rowMedians.c -o r
owMedians.o
gcc-sjlj  -std=gnu99  -IC:/R/R-2.6.2/include     -O3 -Wall  -c runavg.c -o runav
g.o
windres --preprocessor="gcc-sjlj -E -xc -DRC_INVOKED" -I C:/R/R-2.6.2/include  -
i t1_res.rc -o t1_res.o
gcc-sjlj  -std=gnu99  -shared -s  -o t1.dll t1.def CGHseg_rewrite.o rowMedians.o
 runavg.o t1_res.o  -LC:/R/R-2.6.2/bin    -lR
  ... DLL made
  installing DLL
  installing R files
  installing data files
  installing man source files
  installing indices
  not zipping data
  installing help
 >>> Building/Updating help pages for package 't1'
     Formats: text html latex example chm
  checkUploadFileFormat             text    html    latex   example
  runAnalysis                       text    html    latex   example
  runCGHAnalysis                    text    html    latex   example
  preparing package t1 for lazy loading
Loading required package: waveslim
Loading required package: quantreg
Loading required package: SparseM
Loading required package: snapCGH
Loading required package: limma
Loading required package: tilingArray
Loading required package: Biobase
Loading required package: tools

Welcome to Bioconductor

  Vignettes contain introductory material. To view, type
  'openVignette()'. To cite Bioconductor, see
  'citation("Biobase")' and for packages 'citation(pkgname)'.

Loading required package: affy
Loading required package: affyio
Loading required package: preprocessCore

Attaching package: 'affy'


        The following object(s) are masked from package:waveslim :

         pm

Loading required package: RColorBrewer
Loading required package: grid
Loading required package: strucchange
Loading required package: zoo
Loading required package: sandwich
Loading required package: vsn
Loading required package: genefilter
Loading required package: survival
Loading required package: splines

Attaching package: 'survival'


        The following object(s) are masked from package:quantreg :

         untangle.specials

Loading required package: geneplotter
Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: DBI
Loading required package: RSQLite
Loading required package: xtable
Loading required package: lattice
KernSmooth 2.22 installed
Copyright M. P. Wand 1997
Loading required package: pixmap
Loading required package: DNAcopy

Attaching package: 'DNAcopy'


        The following object(s) are masked from package:tilingArray :

         segment

Loading required package: GLAD
Loading required package: aws
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Loading required package: cluster
Loading required package: aCGH
Loading required package: multtest
Loading required package: sma

Attaching package: 'aCGH'


        The following object(s) are masked from package:stats :

         heatmap


Attaching package: 'snapCGH'


        The following object(s) are masked from package:aCGH :

         prop.na

Loading required package: cghFLasso
Loading required package: FASeg
Loading required package: GDD
Warning: 'Sys.putenv' is deprecated.
Use 'Sys.setenv' instead.
See help("Deprecated")
Loading required package: gplots
Loading required package: gtools
Loading required package: gdata

Attaching package: 'gdata'


        The following object(s) are masked from package:Biobase :

         combine


Attaching package: 'gplots'


        The following object(s) are masked from package:multtest :

         wapply


        The following object(s) are masked from package:stats :

         lowess

  adding MD5 sums

* DONE (t1)
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to