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

How to see interpreted/translated code in R?

$
0
0

I'm relatively new to R and I'm trying to better understand how R works under the hood. Often times, I'll get an error that shows syntax that wasn't even in my code. I know there must be a lot of translation going on under the hood. Is there an easy way to see what code is actually executing for a line of code.

For some context, I was using stringr

filterStatement = Orders$clean %like% currow$clean & (Orders$zip5==currow$MailingZip5 | Orders$zip5.1==currow$MailingZip5)

and got this error:

Error in grepl(pattern, vector, ignore.case = ignore.case, fixed = fixed) : 
  invalid regular expression 'XXXX (XXXXXX', reason 'Missing ')''

I figured out that %like% is a wrappr for grep but is there a better way to see that when I type

Orders$clean %like% currow$clean

it's getting converted to

grepl(currow$clean, Orders$clean, ignore.case = FALSE, fixed = FALSE)

Thanks in advance!


Viewing all articles
Browse latest Browse all 201894

Trending Articles



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