[R] uint8

Jiefei Wang @zwj|08 @end|ng |rom gm@||@com
Fri Feb 5 03:36:27 CET 2021

Hi Luca,

The answer to your question depends on your application. What do you want
to do with x3? Do you really need a native vector to represent x1 and x2?
Or you just want an object that behaves like it is a joint of x1 and x2? I
do not think you can have a native vector x3 without paying anything, this
is impractical, but if all you want to do is to have something that behaves
like x3, I think R's S4 class can achieve that.


On Fri, Feb 5, 2021 at 6:36 AM Luca Passalacqua via R-help <
r-help using r-project.org> wrote:

> Dear R users,
>  I am trying to join two 8 bit integers, as defined by the
> "coolbutuseless/uint8" package,
> without success:
> > library(uint8)
> > x1 = uint8(3)> x1[1] = as.uint8(1)
> > x1[2] = as.uint8(2)> x2 = uint8(3)> x2[1] = as.uint8(2)> x1[1] 1 2 0>
> x2[1] 2 0 0> xx = c(x1,x2)> xx[1] 01 02 00 02 00 00
> In the real application the first array (x1) is extremely large (order
> 15-20 Gbytes)
> while the second is relatively small, so that I cannot afford, given my
> RAM,
> to define a third array, as
> > x3 = uint8(length(x1)+length(x2))
> and then fill its components, but I need to join the two arrays.
> Is anyone aware of the right procedure in R or so kind to give suggestions
> ?
> (A possibility would be to switch to C/C++, but I would prefer not to).
> Many thanks,
> Luca
> --
> ________________________________________________________
> Le informazioni
> contenute in questo messaggio di posta elettronica sono strettamente
> riservate e indirizzate esclusivamente al destinatario. Si prega di non
> leggere, fare copia, inoltrare a terzi o conservare tale messaggio se non
> si è il legittimo destinatario dello stesso. Qualora tale messaggio sia
> stato ricevuto per errore, si prega di restituirlo al mittente e di
> cancellarlo permanentemente dal proprio computer.
> The information contained
> in this e mail message is strictly confidential and intended for the use of
> the addressee only.  If you are not the intended recipient, please do not
> read, copy, forward or store it on your computer. If you have received the
> message in error, please forward it back to the sender and delete it
> permanently from your computer system.
> --
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list