0

I am trying to take a look at how the rawToHex() function is implemented in PKI package.

I tried this:

> library(PKI)
Loading required package: base64enc
> PKI::rawToHex
Error: 'rawToHex' is not an exported object from 'namespace:PKI'
> PKI:::rawToHex
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) : 
object 'rawToHex' not found

I am basically trying to understand how to convert raw data to Hex representation in R. So I wanted to take a look at this.

Thomas
  • 43,637
  • 12
  • 109
  • 140
Rookie
  • 5,179
  • 13
  • 41
  • 65

1 Answers1

2

That error is clear: that function is not available in that package. The correct spelling is raw2hex

> PKI::raw2hex
function (what, sep, upper = FALSE) 
.Call(PKI_raw2hex, what, if (missing(sep)) NULL else sep, upper)
<environment: namespace:PKI>

You can't see the source in this way because it is compiled.

Please read this great answer.

Besides that, you can download the source code in CRAN.

Community
  • 1
  • 1
iled
  • 2,142
  • 3
  • 31
  • 43
  • Thanks. The src seems to be C code from CRAN. Any other thoughts on how to implement raw to hex in R without importing any package? The reason I am looking at implementing it in R is as a workaround since I am seeing a compilation error in Vertica when i try to load the pki library – Rookie Dec 15 '15 at 21:38
  • Sorry, no thoughts on that. However, it seems you have two more questions to post: 1) how to implement raw to hex in base R, and; 2) whatever error is that in Vertica when loading the PKI library. – iled Dec 15 '15 at 21:41