Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-21 Thread Dirk Eddelbuettel
Hi Gustaf, On 21 October 2014 at 16:05, Gustaf Granath wrote: | Thanks for the replies. After some testing it seems like I dont need the | unsigned stuff and the functions seems to work fine with just a regular int | variable. Sounds good. | The functions I wanted to use were just small parts

Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-21 Thread Gustaf Granath
Hi all Thanks for the replies. After some testing it seems like I dont need the unsigned stuff and the functions seems to work fine with just a regular int variable. The functions I wanted to use were just small parts of a program and in that program bitmap images were loaded and image data s

Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-21 Thread Tim Keitt
On Mon, Oct 20, 2014 at 2:17 PM, Gustaf Granath wrote: > Hi > Im trying to use some C++ functions in R. However, these functions are > build around unsigned char* variables (1D array). I have for example a > large matrix in R that represents black (e.g. 1-bit image, 0 and 1s). I > cant find a sol

Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-20 Thread Dirk Eddelbuettel
On 20 October 2014 at 23:09, Romain Francois wrote: | > Le 20 oct. 2014 à 21:54, Dirk Eddelbuettel a écrit : | > No, RawVector is for R 'raw' types -- see help("raw") in R, | | Guess what raw is !!! | | > demangle( "RawVector::stored_type" ) | [1] "unsigned char" Touche, but for all uses I hav

Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-20 Thread Romain Francois
Hi, that's not going to fly. A CharacterVector holds strings of arbitrary lengths, well technically it holds other R objects (SEXP) that hold pointers to strings. A RawVector holds unsigned char. Can you add some meat to your example, e.g. what you'd expect to go in, etc ... Romain > Le

Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-20 Thread Romain Francois
> Le 20 oct. 2014 à 21:54, Dirk Eddelbuettel a écrit : > > > Hi Gustaf, > > On 20 October 2014 at 15:17, Gustaf Granath wrote: > | Im trying to use some C++ functions in R. However, these functions are > | build around unsigned char* variables (1D array). I have for example a > | large matri

Re: [Rcpp-devel] convert to unsigned char* variable

2014-10-20 Thread Dirk Eddelbuettel
Hi Gustaf, On 20 October 2014 at 15:17, Gustaf Granath wrote: | Im trying to use some C++ functions in R. However, these functions are | build around unsigned char* variables (1D array). I have for example a | large matrix in R that represents black (e.g. 1-bit image, 0 and 1s). I | cant find

[Rcpp-devel] convert to unsigned char* variable

2014-10-20 Thread Gustaf Granath
Hi Im trying to use some C++ functions in R. However, these functions are build around unsigned char* variables (1D array). I have for example a large matrix in R that represents black (e.g. 1-bit image, 0 and 1s). I cant find a solution to convert a character vector into unsigned char* within