similar to: Question: how to convert raw to numeric

Displaying 20 results from an estimated 900 matches similar to: "Question: how to convert raw to numeric"

2006 Nov 21
2
packBits (PR#9374)
Full_Name: Prokaj Vilmos Version: R 2-4-0 OS: Windows Submission from: (NULL) (193.224.79.8) PackBits(rbinom(32,1,0.5)==1,"integer") does not work. z<-packBits(rbinom(32,1,.5)==1,"integer") Error in packBits(x, type) : argument 'x' must be raw, integer or logical Taking a closer look at the C code main/character.c do_packBits rutin one can find the following
2008 May 09
1
Typo in man page for "packBits" (PR#11435)
One occurence of 'packbits' should be 'packBits' (version information below): Index: src/library/base/man/rawConversion.Rd =================================================================== --- src/library/base/man/rawConversion.Rd (revision 55) +++ src/library/base/man/rawConversion.Rd (working copy) @@ -41,7 +41,7 @@ of 32 times the length of an integer vector with
2008 May 21
1
rawToChar(raw(0))
Hi, right now we have (on R v2.7.0 patched (2008-04-23 r45466)) that: > rawToChar(raw(0)) [1] "" > rawToChar(raw(0), multiple=TRUE) character(0) Is this intended or should both return character(0)? Personally, I would prefer that an empty input vector returns an empty output vector. Same should then apply to charToRaw(), but right now we get: > x <- character(0) >
2011 Apr 19
1
print.raw - but convert ASCII?
Does anyone know if there is a simple way to print raw vectors, such that ASCII characters are printed for bytes in the ASCII range, and their hex representation otherwise? rawToChar doesn't work when we have something like c(0x00, 0x00, 0x44, 0x00). -Matt
2007 Aug 07
2
Embedded nuls in strings
Hi, ?rawToChar 'rawToChar' converts raw bytes either to a single character string or a character vector of single bytes. (Note that a single character string could contain embedded nuls.) Allowing embedded nuls in a string might be an interesting experiment but it seems to cause some troubles to most of the string manipulation functions. A string with an embedded 0:
2013 May 08
1
getting corrupted data when using readBin() after seek() on a gzfile connection
Hi, I'm running into more issues when reading data from a gzfile connection. If I read the data sequentially with successive calls to readBin(), the data I get looks ok. But if I call seek() between the successive calls to readBin(), I get corrupted data. Here is a (hopefully) reproducible example. See my sessionInfo() at the end (I'm not on Windows, where, according to the man page,
2008 Apr 28
4
R 2.7.0, match() and strings containing \0 - bug?
Hi, A piece of my code that uses readBin() to read a certain file type is behaving strangely with R 2.7.0. This seems to be because of a failure to match() strings after using rawToChar() when the original was terminated with a "\0" character. Direct equality testing with == still works as expected. I can reproduce this as follows: > x <- "foo" > y <-
2013 May 03
1
untar() error
Dear List, I have a list of 600+ *.gz files that I would like to extract and read the geotiffs contained within them. I tried using the untar() function to simplify this task but I am stumped by an error. I've combed the Internet for a solution without luck. The details are below, and any help in solving this matter is appreciated. > files = list.files(path = "J:/GIMMS/NDVI",
2013 Jul 15
2
Serialize data.frame to database
Dear R-Users, I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database. This is what I tried to do: library(RSQLite) con <- dbDriver("SQLite") db <- dbConnect(con, "test") dbSendQuery(db, 'CREATE TABLE frames("simID" INT, "data" BLOB)') data.bin <-
2013 Apr 10
1
Issue with Control-Z in a text file on Windows - readLines() appears to truncate
Working on Windows I have had to deal with CSV files that, unfortunately, contain embedded Control-Zs, i.e. ASCII character 26 in decimal, and the readLines() function in R on Windows (2.15.2 and 3.0.0) appears to truncate at the control-Z. There is no problem at all on Ubuntu Linux with R 3.0.0. Am I mistaken or is this genuine? # Create a small file with embedded Control-Z h3 <-
2010 Dec 14
1
Installing R-packages in Windows
Hi there, I have the following problem and I hope somebody might help me. First of all: I am using WinXP SP3 (english and/or german) with R in Version 2.10.0. Now I am trying to install some packages but unfortunately I am getting a weird error. No matter which package I am trying to install - I nearly get the same error. It looks like this:
2008 Oct 28
2
writting null (\000 or ^@) to an external text file without the new warning
I have some functions that write an external text file for postprocessing by another program. Some instructions to the other program need to be indicated by null values (\000 or ^@). The function currently uses code like: writeChar(rawToChar(as.raw(0)), con) where con is a connection to the file. Previous to version 2.8.0 this worked fine. With 2.8.0 it still works, but I get a warning
2008 Sep 25
1
Saving R-objects to a database
Someone solved the problem of saving R-objects to a database? These are the two varaints I've tried so far without success: 1) ser = rawToChar(serialize(obj, NULL, ascii=TRUE)) dbSendQuery(link, paste("insert into table values(1, '",ser,"')",sep='')) The field to save the object in the MySQL Database is of type text. unser = dbGetQuery(link,"select
2006 Sep 05
1
serialize changes for 2.4.0
I noticed today that in R 2.3.1, I get > serialize(list(1,2,3), NULL, ascii = TRUE) [1] "A\n2\n131841\n131840\n19\n3\n14\n1\n1\n14\n1\n2\n14\n1\n3\n" > but in R 2.4.0 alpha I get > serialize(list(1,2,3), NULL, ascii = TRUE) [1] 41 0a 32 0a 31 33 32 30 39 36 0a 31 33 31 38 34 30 0a 31 39 0a 33 0a 31 34 [26] 0a 31 0a 31 0a 31 34 0a 31 0a 32 0a 31 34 0a 31 0a 33 0a >
2011 Oct 21
2
Change column/row-name
Hi, I am very happy. My problems are solved without one little thing: (Iske <- matrix(c(1, 1, 1, 2, 2, 2, 1, 1, 1, 5, 1, 2, 2, 2, 1, 1, 1, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 2), ncol = 5)) #My Matrix Iske<- Iske+33 #I want see the letters (Iske.char<-apply(Iske, 1, function(x) rawToChar(as.raw(x)))) #Numbers to
2012 Sep 19
2
Rcmd check problem
Hi, all. I was trying to build my R package with R 2.15.1 32bit and win7. I basically follow the routine in Steven Mosher's blog http://stevemosher.wordpress.com/step-10-build/ After I fixed the path, and built the skeleton of the package, I started command prompt and used the following commands in building my package Rcmd check myPackageName Rcmd build myPackageName Rcmd check
2012 Nov 04
1
what is the function naming convention?
Dear R people, In typing names of functions (built in or from a package) I often guess wrong, and have to look the name up. In other words, I don't understand the logic in naming functions (if there is any): - most names are plain, lower case: cos, plot, sapply, t, toupper, unserialize, (etc) - some are capitalized: Filter, Machine, Map, NCOL, RNGversion, T (etc) -
2007 Aug 31
1
Consistency of serialize(): please enlighten me
Hi, I am puzzled with serialize(). It comes down generating identical hash codes for (apparently) identical objects using digest::digest(), which in turn relies on serialize(). Here is an example illustration the issue: ser <- function(object, ...) { list( names = names(object), namesRaw = charToRaw(names(object)), ser = serialize(names(object), connection=NULL, ascii=FALSE)
2010 Jul 27
2
Match() on raw objects ?
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100727/2e19110f/attachment.pl>
2017 Oct 20
1
Another issue with Sys.timezone
>>>>> Stephen Berman <stephen.berman at gmx.net> >>>>> on Thu, 19 Oct 2017 17:12:50 +0200 writes: > On Wed, 18 Oct 2017 18:09:41 +0200 Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>>>> Martin Maechler <maechler at stat.math.ethz.ch> >>>>>>> on Mon, 16 Oct 2017 19:13:31 +0200