Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201977

split the superhero names with their ages in the given vector

$
0
0

Given this vector:

vector <- c("Superman1000", "Batman35", "Wonderwoman240") 

I want to split the superhero's name and age.

df=data.frame(vector= c("Superman1000", "Batman35", "Wonderwoman240"))

library(stringr)
library(stringi)
library(dplyr)

df %>% separate(vector, c("A", "B"))

I tried this but it doesn't work.


Viewing all articles
Browse latest Browse all 201977

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>