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

Assigning value to variable in R with string pattern matching

$
0
0

I have to detect Name: and assign the value to any variable. I am trying to use str_match, but it takes only Sunil

x = c("Name: Sunil Raperia ")
xx = str_match(x, "Name: (.*?) ")
xx

I want to assign Sunil Raperia to xx.


Viewing all articles
Browse latest Browse all 209005

Latest Images

Trending Articles



Latest Images

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