Description Usage Arguments Details Examples
Match two time sequences for a Spectra
object, where each can be intervals or instances.
1 | spc.timeMatch(master,searched,returnList,method,limits,report)
|
master |
ordered sequence of variable of class |
searched |
A variable of class |
returnList |
Boolean; should a list be returned with all matches (TRUE), or a vector with single matches (FALSE)? |
method |
Method used in time-based matching. See the details section. |
limits |
the interval limits |
report |
return character string which has information about searching results, default is False |
spc.timeMatch is similar to spacetime::timeMatch(), only adding some more matching methods. When method is "over", the same technique used by spacetime::timeMatch() is used. Useful when matched timestamps of both master and searched are exactly equal. When method is "nearest", the nearest measurement will be found, matching only one data for ALL elements of master. When method is "within", measurements that are within the interval limits=c(upper,lower) (in seconds) will be found.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #Read the Nomad database inside a SpcList object.
dat = SpcList(spc.Read_NOMAD_v2())
#Different list elements containt different parameters
names(dat)
#We would like to find elements of Es that match time-wise rows of Kd.
nrow(dat$kd); nrow(dat$es)
#Use spc.timeMatch() to get row indexes of Es that would match those of Kd time-wise
t_idx=spc.timeMatch((dat$kd), (dat$es))
#Verification
all(time(dat$es)[t_idx]==time(dat$kd))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.