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

Pattern greater less than sign

$
0
0

I want to clean special characters from variable.

mm = data.frame(rule = c('$X <= 0', '$X > 0 & $X <= 17.5', '> 17.5 & $X <= 197.3', '$X > 197.3'))
mm$ruleclean <- gsub('\\&','',gsub('\\s+','',gsub('\\$X', '', mm$rule)))

Desired Output:

<=0
0 - 17.5
17.5 - 197.3
> 197.3

Objective is to convert it into intervals


Viewing all articles
Browse latest Browse all 201867

Trending Articles



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