Description Usage Arguments Value Examples

View source: R/complete_measures.R

The function complete_measures() is used to look for and come back missing measures of the raw data. Typically some raw data doesn't include the irrelevant (below some threshold) measures in order to reduce the size of the final file. This function brings back those measures, assigning them a 0 intensity value.

1 2 | ```
complete_measures(vecttemps, vectmasses, vectintensitats,
vectintensitatsTOTALS = NULL)
``` |

`vecttemps` |
Vector with the time serie (unfolded) |

`vectmasses` |
Vector indicating the mass from each measure |

`vectintensitats` |
Vector with the measures |

`vectintensitatsTOTALS` |
Vector with the TIC's measures. It is used to check if the function's result is ok |

A matrix (mass x time) with all the measures. The originals (`vectintensitats`

) and the ones the function has added (with 0 intensity)

1 2 3 4 5 6 7 8 9 10 11 | ```
time<-1:10
masses_complete<-rep(46:50,length(time)) #vectr indicating the mass (45 to 50) each measure belongs to
intensities_complete<-sample(1:1000, length(masses_complete))
#we simulate an omission in the measure of the mass 47 on the spot time=5 seconds
positionwewantremove<-which(masses_complete==47)[5]
masses_incomplete<-masses_complete[-positionwewantremove]
intensities_incomplete<-intensities_complete[-positionwewantremove]
#We use the function in order to have a complete raw data again (reshaped as a matrix)
complete_measures(time,masses_incomplete,intensities_incomplete)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.