Hi,

Using the R C PAI, is there a way to convert to convert STRSXP or INTSXP to
factor.

The idea would be to do in C something similar to the "factor" function
(example below):

> letters[1:5]
# [1] "a" "b" "c" "d" "e"

> factor(letters[1:5])
# [1] a b c d e
# Levels: a b c d e

There is the function setAttrib the levels of a SXP however when returned
to R the object is of type character not factor. Ideally what i would like
to return from the C function is the same output as above when the input is
of type character.

Please let me if you need more informations.
Thank you
Best regards
Morgan

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to