This package aims to bring common perl regular expression functonality to R There are two major functions, m for regular expression matching and s for substitution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | library(perlrer)
string = 'This is a test'
#using the functional style
m(string, 'this', 'i')
#using the perl infix function style
string %m% '/this/i'
#substitutions
string = 'This is a test'
s(string, 'this', 'that', 'i')
string %s% '/this/that/i'
#perl join and split for strings
pjoin(' ', string)
psplit(' ', string)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.