Skip to content
Prev 15747 / 63461 Next

How allocate STRSXP outside of gc

mkChar is a rather expensive call since it allocates a new R object. For
example in reading char data from a file it is often advantageous to
first try to look up an already made R string and only then use mkChar.
That is, the overhead of the lookup is usually smaller than that of
mkChar.