search for: as_charact

Displaying 3 results from an estimated 3 matches for "as_charact".

Did you mean: as_character
2007 Feb 20
2
Problem with types on 64-bit
...hen it tries to set dta.start it displays: CHAR() can only be applied to a 'CHARSXP', not a 'NULL' (2) if I pass a valid string such as "hello", I get the following: CHAR() can only be applied to a 'CHARSXP', not a 'character' I have tried converting using AS_CHARACTER but that just brings up the same messages. I have also seen S4 and PROMSXP types come up in these error messages. What I don't understand is why this happens - any ideas? If I can supply any more info let me know, below is the CPU information for the 64-bit machine. Many thanks for you...
2003 Oct 04
3
More questions about R extension programming
...to > read in these files (and also to learn about R extensions). Thanks for the pointers to the above question. I have a few more! 1) I would like my C function to be passed a character string. Thus I define the function as SEXP _loadsets(SEXP filename) { FILE *f; PROTECT(filename = AS_CHARACTER(filename)); f = fopen(filename,"r"); UNPROTECT(1); ..... ..... } However compiling it gives me: loadset.c: In function `_loadsets': loadset.c:25: warning: passing arg 1 of `fopen' from incompatible pointer type gcc -shared -L/usr/local/lib -o loadset.so loadset.o How...
2004 Nov 29
1
data is getting corrupted
...e I'm using PROTECT correctly (the examples in the docs don't appear very thourough) and included a snippet below, SEXP r_write_sample_to_file( SEXP sample_in, SEXP filename ) { unsigned long return_code; struct SAMPLE_RECORD *sample_ptr; SEXP ans; PROTECT( filename = AS_CHARACTER( filename ) ); PROTECT(ans = allocVector(INTSXP, 1)); PROTECT( sample_in = AS_LIST( sample_in ) ); sample_ptr = build_sample_from_sexp( sample_in ); write_sample_to_file( &return_code, CHAR(STRING_ELT(filename, 0)), sample_ptr, N_SPECIES, SPECIES_PT...