SCM

SCM Repository

[batman] View of /pkg/batman/R/getSpectraRange.R
ViewVC logotype

View of /pkg/batman/R/getSpectraRange.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 120 - (download) (annotate)
Tue Feb 12 16:30:46 2013 UTC (6 years, 7 months ago) by jie
File size: 557 byte(s)
pkg
getSpectraRange <- function(myVector)
{
## written by Dr. Jie Hao
  ranges <- strsplit(myVector[[1]][2],",")
  sno <- NULL
  for (rgs in 1:length(ranges[[1]]))
  {
    ranges2 <- strsplit(ranges[[1]][rgs], "-")
    ranges3 <-as.numeric(ranges2[[1]])
    if (length(ranges3)>1)
    {
      if (ranges3[1]>ranges3[2])
      {
        tmp1 <- ranges3[1]
        ranges3[1] <- ranges3[2]
        ranges3[2] <- tmp1
      }
    } else {
      ranges3[2] <- ranges3[1]
    }
    sno <- c(sno, ranges3[1]:ranges3[2])
  }
  
  return (sno)
}

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge