R

[R] split strings with periods

StatZealot 2020. 12. 20. 00:30

마침표(.)는 pattern 으로 인식할 때 "[.]" 또는 "\\." 와 같이 써야 한다.

 

library(stringr)

sapply(str_split(strings, "[.]"), function(x) x[1])