On Jun 22, 2006, at 9:04 AM, Dominick Samperi wrote:
> Thanks for the tips,
>
> This seems to work:
> First test for isReal and isInteger.
> If they fail, assume character/factor, and
>
> PROECT(colData = coerceVector(colData,INTSXP); // Not STRSXP
> SEXP names = getAttrib(colData, R_LevelsSymbol
Thanks for the tips,
This seems to work:
First test for isReal and isInteger.
If they fail, assume character/factor, and
PROECT(colData = coerceVector(colData,INTSXP); // Not STRSXP
SEXP names = getAttrib(colData, R_LevelsSymbol);
// names now contains the string names I was looking for.
ds
Hin
Hin-Tak Leung wrote:
> I think you want
> else if (TYPEOF(colData) == STRSXP)
> ... instead.
>
> I don't know if this will convert from factors to string's,
> but somewhere it probably involves something like this:
> PROTECT(colData = coerceVector(colData, STRSXP));
FWIW, a factor co
I think you want
else if (TYPEOF(colData) == STRSXP)
... instead.
I don't know if this will convert from factors to string's,
but somewhere it probably involves something like this:
PROTECT(colData = coerceVector(colData, STRSXP));
Dominick Samperi wrote:
> Hello,
>
> I'm trying to
On Wed, 21 Jun 2006, Kasper Daniel Hansen wrote:
> While I do not know how to handle this on the C level, I know that
> you do not have characters in data frames, everything is factors
> instead.
Not so. The default in data.frame() is to convert character vector to
factors, but there are many w
While I do not know how to handle this on the C level, I know that
you do not have characters in data frames, everything is factors
instead. Internally they are coded as a number of integer levels,
with the levels having labels (which is the character you see). So eg
(in R):
> test <- dat