
Last chance! 50% off unlimited learning
Sale ends in
cpos
finds the first position of a substring
cposR
returns a list with starting and ending
positions, works only with a single string.cpos(str,sub,start=1)
cposR(str, sub, restrict)
cpos
number, if found, NA otherwise.
cposR
list(first,last) for each occurrence
If there is none of first=NA,last=NA.cpos("Baldrian","a",5) # 8
cpos("Baldrian","B",15) # NA
cposR("In theese housees there are rats","ees")
#$first [1] 6 15
#$last [1] 8 17
Run the code above in your browser using DataLab