search for: charsxp

Displaying 20 results from an estimated 144 matches for "charsxp".

2014 Mar 17
1
Deep copy of factor levels?
...22 > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 385991 20.7 1074393 57.4 10049951 536.8 Vcells 104672187 798.6 112367694 857.3 204862160 1563.0 > .Internal(inspect(levels(xx[[1]]))) @387f620 16 STRSXP g1c7 [MARK,NAM(2)] (len=10000, tl=0) @144da4e8 09 CHARSXP g1c1 [MARK,gp=0x60] [ASCII] [cached] "1" @144da518 09 CHARSXP g1c1 [MARK,gp=0x60] [ASCII] [cached] "2" @27d1298 09 CHARSXP g1c1 [MARK,gp=0x60] [ASCII] [cached] "3" @144da548 09 CHARSXP g1c1 [MARK,gp=0x60] [ASCII] [cached] "4" @144da578 09 CHARSXP...
2009 Oct 01
1
Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character' & 'getEncChar' must be called on a CHARSXP
...er |__ Named List of 6 elements (characters and numerics) This works, sip <- lapply(h,function(r) r[[2]][['sip']]) but I wish to unlist this sip <- unlist(lapply(h,function(r) r[[2]][['sip']])) and get the following error: Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'list' Debugging to find which: i<-1 sip <- unlist(lapply(h,function(r) { i<<-i+1 #debug messages cat(i,"------------------>","\n"); print( r[[2]] ) #debug message r[[2]][['sip']] })) [1]Error in print.default(r[[2]]) : 'getE...
2019 May 10
2
ALTREP: Design concept of alternative string
...t even did not call Dataptr_or_null first) and forces me to allocate a large chunk of memory in R. Updating these functions would not completely solve the problem we are discussing but will make it less serious. 2. Update the ALTREP API, return a vector of const char *, and internally wrap them as CHARSXP. This can be a way to "hack" the R data structure with only a little cost to create the CHARSXP header. 3. Provide character ALTREP. Instead of using string ALTREP, we can define an alternative CHARSXP. By doing it we will completely solve the problem since the return value of the Datapt...
2019 May 08
2
ALTREP: Design concept of alternative string
...ibrary. The concept is similar to mmap package: https://cran.r-project.org/web/packages/mmap/index.html . However, I have a problem when I was trying to write Dataptr_method for the alternative string. Based on my understanding, the return value of the Dataptr_method function should be a vector of CHARSXP pointers. This design might be problematic in two ways: 1. The behavior of Dataptr_method function is inconsistent for string and the other ALTREP types. For the other types we return a vector of pure data in memory allocated outside of R, but for the string, we return a vector of R objects alloca...
2016 Feb 13
1
Question about CHARSXP and garbage collection
Hi, I had a technical question about CHARSXP and garbage collection and couldn't find the answer in the R manual. The question is this. Are CHARSXP garbage collected like any other object, despite being part of the CHARSXP cache? i.e. is the cache being cleaned by garbage collection regularly and therefore, when I am in C code, do I need...
2007 May 25
0
Recent changes in R related to CHARSXPs
Hello all, I want to highlight a recent change in R-devel to the larger developeR community. As of r41495, R maintains a global cache of CHARSXPs such that each unique string is stored only once in memory. For many common use cases, such as dimnames of matrices and keys in environments, the result is a significant savings in memory (and time under some circumstances). A result of these changes is that CHARSXPs must be treated as read only...
2009 Nov 01
2
Internal error in 'ls' for pathological environments (PR#14035)
...it is not, it should presumably give an error. If it is, then ls shouldn't have problems with the resulting environment. > qq <- with(list(2),ls()) # An incorrect call (no names in list) > nchar(qq) Error in nchar(qq) : 'getEncChar' must be called on a CHARSXP # ls returned a bad object > qq [1]Error: 'getEncChar' must be called on a CHARSXP > qq[1] [1]Error: 'getEncChar' must be called on a CHARSXP > qq[2] [1] NA Apparently related: > with(list(a=1,2),ls()) Error in ls() : 'getEncChar' must be called on a CHARSXP...
2012 Feb 16
1
Unstable reproduce for potential issue with CHARSXP creation
I stumbled across one of those intermittent bugs where the code sometimes works and sometimes doesn't. Below is an example run showing a failure where a CHARSXP object was not properly created (by the sub function?). I was able to reproduce this error on three different R builds in fresh R sessions, but it sometimes takes a few start up R -> run code -> close R iterations for the error to show itself. > x <- data.frame("X1" = 1)...
2017 Aug 23
2
Error "translateCharUTF8' must be called on a CHARSXP Execution halted"
...ems to be doing fine at first sight. However, when I try to list the files in a directory with the command files <- list.files(path="/home/username/directory_name/", pattern="*.Rda",, full.names=T, recursive=FALSE) I get the error translateCharUTF8' must be called on a CHARSXP Execution halted On my local windows machine the command works fine. Googling this nothing really comes up except that the installation might be broken. (See http://r.789695.n4.nabble.com/list-files-error-message-translateCharUTF8-must-be-called-on-a-CHARSXP-td3250302.html) The strange thing is,...
2020 Jul 22
3
Invisible names problem
I ran into strange behavior when removing names. Two ways of removing names: i <- rep(1:4, length.out=20000) k <- c(a=1, b=2, c=3, d=4) x1 <- unname(k[i]) x2 <- k[i] x2 <- unname(x2) Are they identical? identical(x1,x2) # TRUE but no identical(serialize(x1,NULL),serialize(x2,NULL)) # FALSE But problem is with serialization type 3, cause:
2019 May 10
0
[External] Re: ALTREP: Design concept of alternative string
...e option for your implementation is to signal an error if a data pointer is requested. You could make that dependent on some sort of option setting or make the error continuable by providing a restart. > 2. Update the ALTREP API, return a vector of const char *, and internally > wrap them as CHARSXP. This can be a way to "hack" the R data structure with > only a little cost to create the CHARSXP header. That doesn't seem feasible but I may not be understanding what you mean. > 3. Provide character ALTREP. Instead of using string ALTREP, we can define > an alternative C...
2017 Aug 23
0
Error "translateCharUTF8' must be called on a CHARSXP Execution halted"
...st sight. However, when I try to list the files in a directory with the command > > files <- list.files(path="/home/username/directory_name/", pattern="*.Rda",, full.names=T, recursive=FALSE) > > I get the error > > translateCharUTF8' must be called on a CHARSXP > Execution halted > > On my local windows machine the command works fine. > Googling this nothing really comes up except that the installation might be broken. (See http://r.789695.n4.nabble.com/list-files-error-message-translateCharUTF8-must-be-called-on-a-CHARSXP-td3250302.html) >...
2011 Dec 20
1
RODBC Error: 'getCharCE' must be called on a CHARSXP
...gion, Price FROM TableXYZ WHERE Type="Domestic"' sqlQuery(channel, cat(txt,"\n"),errors=TRUE,) close(channel) However, I get the following error immediately after sqlQuery command: Error in odbcQuery(channel, query, rows_at_time) : 'getCharCE' must be called on a CHARSXP I believe my connection is good because I used the following commands to successfully view the columns: sqlColumns(channel, TableXYZ) There doesn't seem to be much info on "getCharCE" and/or "CHARSXP. Any guidance the group could provide this vey new user to R, would be great...
2020 Jul 22
0
Invisible names problem
...[i])) @10a4bc000 14 REALSXP g0c7 [ATT] (len=20000, tl=0) 1,2,3,4,1,... ATTRIB: @7fa24f07fa58 02 LISTSXP g0c0 [REF(1)] TAG: @7fa24b803e90 01 SYMSXP g0c0 [MARK,REF(5814),LCK,gp=0x6000] "names" (has value) @10a4e4000 16 STRSXP g0c7 [REF(1)] (len=20000, tl=0) @7fa24ba575c8 09 CHARSXP g0c1 [MARK,REF(35005),gp=0x61] [ASCII] [cached] "a" @7fa24be24428 09 CHARSXP g0c1 [MARK,REF(35010),gp=0x61] [ASCII] [cached] "b" @7fa24b806ec0 09 CHARSXP g0c1 [MARK,REF(35082),gp=0x61] [ASCII] [cached] "c" @7fa24bcc6af0 09 CHARSXP g0c1 [MARK,REF(35003...
2019 May 09
0
ALTREP: Design concept of alternative string
...The issue here is that while the memory consequences of what you're describing may be true, this is simply how R handles character vector (what you're calling string) values internally. It doesn't actually have anything to do with ALTREP. Standard character vector SEXPs have an array of CHARSXP pointers in their payload (what is returned by DATAPTR) as well. As far as I know, this is important for string caching and is actually intended to save memory when the same string value appears many times in an R session (and takes up more bytes than a pointer), though I haven't dug around R...
2019 Jul 17
2
ALTREP wrappers and factors
...Internal(inspect(fc1)) @7fb0cae66408 13 INTSXP g0c2 [OBJ,NAM(2),ATT] (len=3, tl=0) 1,1,2 ATTRIB: @7fb0ce771868 02 LISTSXP g0c0 [] TAG: @7fb0c80043d0 01 SYMSXP g1c0 [MARK,LCK,gp=0x4000] "class" (has value) @7fb0c9fcbe90 16 STRSXP g0c1 [NAM(7)] (len=1, tl=0) @7fb0c80841a0 09 CHARSXP g1c1 [MARK,gp=0x61] [ASCII] [cached] "factor" TAG: @7fb0c8004050 01 SYMSXP g1c0 [MARK,NAM(7),LCK,gp=0x4000] "levels" (has value) @7fb0d1dd58c8 16 STRSXP g0c2 [MARK,NAM(7)] (len=2, tl=0) @7fb0c81bf4c0 09 CHARSXP g1c1 [MARK,gp=0x61] [ASCII] [cached] "a"...
2011 Feb 01
1
list.files() error message: 'translateCharUTF8' must be called on a CHARSXP
...crnt.files <- list.files(dir.to.check, full.names=TRUE, all.files=TRUE, recursive=TRUE) With dir.to.check set to the full path to my home directory. After a while I get: Error in list.files(dir.to.check, full.names = TRUE, all.files = TRUE, : 'translateCharUTF8' must be called on a CHARSXP This happens on one of my two machines, not the other. Presumably there is a "file" somewhere in my home directory that, well, isn't a file? Or maybe has some strange character in its file name? That maybe isn't valid in my LOCALE? I would appreciate some advice on how to find t...
2018 May 14
3
Rd parser throws error for user macros invoked with empty argument
Bug or feature? I get the following error from parse_Rd() when a user Rd macro (including system ones) is invoked with empty argument {}, eg \mymacro{}: Error in tools::parse_Rd(fn) : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'NULL' A full example is further below with the system macro \CRANpkg{}. In this example it doesn't make sense to use empty argument but the error is not specific to this particular macro. ------ Georgi Boshnakov Create an Rd file containing system macro \CRANpkg{bibtex},...
2019 Jul 19
2
ALTREP wrappers and factors
...(2),ATT] (len=3, tl=0) 1,1,2 > > ATTRIB: > > @7fb0ce771868 02 LISTSXP g0c0 [] > > TAG: @7fb0c80043d0 01 SYMSXP g1c0 [MARK,LCK,gp=0x4000] "class" (has > > value) > > @7fb0c9fcbe90 16 STRSXP g0c1 [NAM(7)] (len=1, tl=0) > > @7fb0c80841a0 09 CHARSXP g1c1 [MARK,gp=0x61] [ASCII] [cached] > > "factor" > > TAG: @7fb0c8004050 01 SYMSXP g1c0 [MARK,NAM(7),LCK,gp=0x4000] > "levels" > > (has value) > > @7fb0d1dd58c8 16 STRSXP g0c2 [MARK,NAM(7)] (len=2, tl=0) > > @7fb0c81bf4c0 09 CHARSXP...
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
...quot; "tack" "tock" [[2]] [1] "tick" "tack" "tock" where I would expect the second element of the list to not be modified. Is this intended ? If not, I can track it down to the DUPLICATE_ATOMIC_VECTOR in duplicate.c and submit a patch. Also, CHARSXP don't seem to be actually duplicated : case CHARSXP: return s; Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/OIXN : raster images and RImageJ |- http://tr.im/OcQe : Rcpp 0.7.7 `- http://tr.im/O1wO : highligh...