similar to: crash with NAs in subscripted assignment of a raw vector

Displaying 20 results from an estimated 3000 matches similar to: "crash with NAs in subscripted assignment of a raw vector"

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) >
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 <-
2007 Jul 21
2
dict package: dictionary data structure for R
Hi all, The dict package provides a dictionary (hashtable) data structure much like R's built-in environment objects, but with the following differences: - The Dict class can be subclassed. - Four different hashing functions are implemented and the user can specify which to use when creating an instance. I'm sending this here as opposed to R-packages because this package will
2010 Jun 03
1
named empty list
Hi, I just realized that a named empty list is displayed the same way as an empty list: > list(aa=2:5)[0] list() > list() list() For empty atomic vectors, the print method makes the difference: > c(aa=3L)[0] named integer(0) > integer(0) integer(0) Maybe lists could do that too? Thanks, H. > sessionInfo() R version 2.12.0 Under development (unstable)
2010 Mar 31
1
as(1:4, "numeric") versus as.numeric(1:4, "numeric")
Hi, > class(as(1:4, "numeric")) [1] "integer" Surprising but an explanation could be that an integer vector being a particular case of numeric vector, this coercion has nothing to do because 1:4 is already numeric. And indeed: > is.numeric(1:4) [1] TRUE > is.numeric(as(1:4, "numeric")) [1] TRUE However, 'as(1:4,
2010 Jul 09
2
Compress string memCompress/Decompress
Hello, I would like to compress a long string (character vector), store the compressed string in the text field of a SQLite database (using RSQLite), and then load the text back into memory and decompress it back into the the original string. My character vector can be compressed considerably using standard gzip/bzip2 compression. In theory it should be much faster for me to compress/decompress
2008 Jul 24
2
NAs - NAs are not allowed in subscripted assignments
Dear List, I ran into some trouble handling missing values. Assume 2 vectors (numeric) including NAs a <- c(rep(seq(1,4),4),NA,NA) b <- c(sample(1:2,14,replace=T),NA,NA,1,2) I want to replace the values of vector a that are smaller than 2 and larger than 3 into NAs only in case vector b equals 1 a[b==1][a[b==1]<2 | a[b==1]>3] <- NA The following error accurse: NAs are not
2011 Sep 23
2
cbind() crashes on raw vectors
Hi, cbind() doesn't seem to like raw vectors: > df <- cbind(a=integer(4000), b=raw(4000)) > df *** glibc detected *** /home/hpages/R-2.13.1/bin/exec/R: malloc(): memory corruption: 0x0000000002d73ca0 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x79d7a)[0x7f3592b91d7a] /lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x6e)[0x7f3592b9431e]
2005 Apr 25
2
RAW types not restored from Rda files (PR#7812)
Full_Name: Byron Ellis Version: 2.1.0 OS: OS X Submission from: (NULL) (67.124.246.46) > x = charToRaw("12345") > x [1] 31 32 33 34 35 > save(x,file="x.Rda") > rm(x) > load("x.Rda") > x [1] 00 00 00 00 00 Thats no fun.
2005 Jun 02
1
print()ing of raw matrices (PR#7912)
Not a bug in a very strict sense, but still something to be fixed eventually: > s <- sapply(0:7, function(i) rawShift(charToRaw("my text"),i)) > s ... nothing is printed at all > str(s) raw [1:7, 1:8] 6d 79 20 74 ... > c(s) [1] 6d 79 20 74 65 78 74 da f2 40 e8 ca f0 e8 b4 e4 80 d0 94 e0 d0 68 c8 00 a0 [26] 28 c0 a0 d0 90 00 40 50 80 40 a0 20 00 80 a0 00 80 40 40 00
2005 Apr 03
1
Error: NAs are not allowed in subscripted assignments: change from R.1.9
Hi, There seems to be a change in 2.0.1 in the workings of subscript assignments with missing values. # This is R.2.0.1 # assignment w/ missing index doesn't work when right-hand-side is a matrix. It did work in 1.9.1 > x = matrix(1, 2, 2); x[c(1,NA),] = x Error: NAs are not allowed in subscripted assignments # it does work for a vector > x = matrix(1, 2, 2); x[c(1,NA),] = 1 Is this
2009 Jan 08
1
NAs are not allowed in subscripted assignments
Browse[1]> j <- c(1,2,NA) Browse[1]> j[j==1][-1] [1] NA Browse[1]> j[j==1][-2] [1] 1 Browse[1]> j[j==1][-2] <- 2 Error during wrapup: NAs are not allowed in subscripted assignments As far as I can see, I have no NA in the lhs (not after the second subscript anyway). Besides, I have a single value on the rhs, so it should be allowed to have NAs in the lhs, according to
2009 Jun 02
2
formal argument "envir" matched by multiple actual arguments
Hi list, This looks similar to the problem reported here https://stat.ethz.ch/pipermail/r-devel/2006-April/037199.html by Henrik Bengtsson a long time ago. It is very sporadic and non-reproducible. Henrik, do you remember if your code was using reg.finalizer()? I tend to suspect it but I'm not sure. I've been hunting this bug for months but today, and we the help of other Bioconductor
2010 Apr 09
3
NAs are not allowed in subscripted assignments
I'm trying to assign NAs to values that satisfy certain conditions (more complex than shown below) and it gives the right result, but breaks the loop having done the first one viz: new<-c(rep(5,4),6) for (i in 1:6) {new[new[i]>5.5][i]<-NA} gives the correct result, though an error message appears which causes a break if it's in a loop. If I can get rid of the error message and
2009 Mar 05
0
predict.fda - NAs are not allowed in subscripted assignments
Dear R users, I'm trying to perform flexible discriminant analysis (fda) with method bruto. I applied the fda function on my training data: bruto.fda <- fda (fda.formula,data=train.data) where fda.formula is: PRES ~ VA_D123 + VA_D124 + VA_D127 + VA_DARU + VA_DCAN + VA_DFON + VA_DLAP + VA_DRID + VA_DRIR + VA_VVEG + VA_WDIN + VA_DIF3 + VA_DIF4 + VA_DIF5 + VA_CAAC + VA_CABC +
2007 Aug 16
0
Customizing locale settings in CentOS-4.5
I am trying to determine how to customize the date and time display of system utilities and user programs using the locale settings. What I really want is some sort of utility program that does the same thing for CentOS as the Regions Settings Control Panel app. for MicroSoft Windows accomplishes, but I have no hope of seeing that. I have traced the login locale processing through /etc/profile
2009 Oct 16
1
(PR#14012)
I think Rscript has a problem running files that have mac encodings for newline (^M rather than ^J on linux). If I source the file within R, it works okay: > source('j.R') [1] "MEA_data/sernagor_new/CRX_P7_1.txt" But if I run the file using Rscript on a linux box I get a strange error message: $ Rscript --vanilla j.R " Execution halted The example script j.R is at
2010 Jan 19
1
calling setGeneric() twice
Is it safe to call setGeneric twice, assuming some setMethod's for the target function occur in between? By "safe" I mean that all the setMethod's remain in effect, and the 2nd call is, effectively, a no-op. ?setGeneric says nothing explicit about this behavior that I can see. It does say that if there is an existing implicity generic function it will be (re?)used. I also tried
2010 Mar 17
1
Suggestion: Not having to export .conflicts.OK in name spaces
Currently library() and attach() fail to locate an existing '.conflicts.OK' in a package wit name space, unless it is exported. Since there should be little interest in exporting '.conflicts.OK' otherwise, one may argue that those methods should look for '.conflicts.OK' even if it is not exported. If so, a patch for library() is: >svn diff library.R Index: library.R
2010 Mar 19
1
DESCRIPTION: Imports: assertion of version?
Hi, from 'Writing R Extensions' [R version 2.11.0 Under development (unstable) (2010-03-16 r51290)] one can read: "The optional `Imports' field lists packages whose name spaces are imported from but which do not need to be attached. [...] Versions can be specified, but will not be checked when the namespace is loaded." Is it a design decision that version specifications