Skip to content
Prev 3762 / 15379 Next

[R-es] Encontrar patrón en array

¿algo así?

sapply( 1:(length(b)-length(s)+ 1), function(i) all(s == b[i:(i+length(s)-1)]))
[1] FALSE FALSE FALSE  TRUE FALSE FALSE

Un saludo,

Carlos J. Gil Bellosta
http://www.datanalytics.com


El día 16 de abril de 2012 18:04, Alberto Soria
<alberto.soria en ari-solar.es> escribió: