[Rd] PPC package-ppc.read.raw.nobatch (PR#8316)

From: <martin.o'gorman_at_nonlinear.com>
Date: Wed 16 Nov 2005 - 13:37:44 GMT

Full_Name: Martin O'Gorman
Submission from: (NULL) (

I have been looking at the PPC package and have a question. As the input data is comma separated, shouldn’t the command to read in the raw (no batch) mass spec data indicate that sep=”,” (marked below) ? Otherwise, the data read in is the pair of values (m/z,intensity). It is not obvious why that should be. While playing around with the data, I noticed that xtr (the intensity matrix) is a full matrix of value NA as a result of omitting the “,”. I apologize in advance if I have missed something obvious. However, the batch read function does use the sep=”,”. This possible bug doesn't doesn't crash the script and so is difficult to spot.  

Many thanks


ppc.read.raw.nobatch <- function(directory, mz = NULL) {

  datafiles.list <- ppc.xl.get.names.of.files(directory)   


## First determine the dimensions of the data matrix


  if (is.null(mz)) {

    pat1 <- read.table(datafiles.list[1]) ----- here

    mz <- pat1[,1]


  xtr <- matrix(NA, nrow=length(mz), ncol=length(datafiles.list))  


## Now read in all the data


  for (j in 1:length(datafiles.list)) {

    if (ppc.options$debug) print(paste("Reading file", datafiles.list[j]))     

    temp <- read.table(datafiles.list[j], sep = ",")     

    xtr[, j] <- approx(temp[, 1], temp[, 2], xout = mz)$y


  return(list(xtr = xtr,

              mz = mz,



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Nov 17 00:43:24 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:33 GMT