Search
 
SCRIPT & CODE EXAMPLE
 

R

str_extract all using mutate and toString

library(purrr)
d %>%
   mutate(y = str_extract_all(x, "d{2}") %>%
                 map_chr(toString))
# A tibble: 3 x 2
#  x                              y     
#  <chr>                          <chr> 
#1 i am 10 and she is 50          10, 50
#2 he is 32 and i am 22           32, 22
#3 he may be 70 and she may be 99 70, 99
Comment

PREVIOUS NEXT
Code Example
R :: correlation matrix using factors r 
R :: alpha 2 codes in r 
R :: r read.csv tab delimited 
R :: rmarkdown how to load workspace 
R :: How to create a new column with spark_apply 
R :: get plot title over two lines R 
R :: norm,s,inv in r 
R :: index in r 
R :: dummify data in r 
R :: generate random values binomial law in r 
R :: ways to examine model in r 
R :: Pass argument to group_by (2) 
R :: emf from r plot 
Rust :: rust random number in range 
Rust :: char byte size rust 
Rust :: rust case 
Rust :: how to export a macro in rust 
Rust :: rust const string 
Rust :: find smallest number in vec rust 
Rust :: rust function 
Rust :: armanriazi•rust•string 
Rust :: Read a floating point number from stdin 
Rust :: armanriazi•rust•error•[E0782]: trait objects must include the `dyn` keyword 
Rust :: how to get text from a file and store it in a variable rust 
Rust :: armanriazi•rust•refactor•flowcontrol•match•unwrap_or_else 
Lua :: roblox studio teleport on collision 
Lua :: lua calculate average number 
Lua :: gfjhhkn roblox 
Lua :: lua printing 
Lua :: roblox math.random 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =