Displaying 20 results from an estimated 150 matches for "charsxps".
Did you mean:
charsxp
2014 Mar 17
1
Deep copy of factor levels?
Hi
It seems that selecting an element of a factor will copy its levels
(Ubuntu 13.04, R 3.0.2). Below is the output of a script that creates a
factor with 10000 elements and then calls as.list() on it. The new
object seems to use more than 700 MB, and inspection of the levels of
the individual elements of the list suggest that they are distinct objects.
Perhaps some performance gain could
2009 Oct 01
1
Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'character' & 'getEncChar' must be called on a CHARSXP
Hello,
I have list of 600K lists, each sublist a list of two elements, the
first a character, the second a list of six named elements, some
characters some numrics.
LISTA (600K) (:= h)
|__ List of two elements
|__ Character
|__ Named List of 6 elements (characters and numerics)
This works,
sip <- lapply(h,function(r) r[[2]][['sip']])
but I wish to unlist this
2019 May 10
2
ALTREP: Design concept of alternative string
...REP 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 allocated by R.
>>
>> 2. It causes an unnecessary duplication of the data. In order to return
>> CHARSXPs to R, It forces me to allocate CHARSXPs and copy the entire data
>> to the R process. By contrast, for the other ALTREP types, say altreal, I
>> can just return the pointer to R if the data is in the memory.
>>
>> The same problem occurs for Elt_method as well but is less se...
2019 May 08
2
ALTREP: Design concept of alternative string
...r_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 allocated by R.
2. It causes an unnecessary duplication of the data. In order to return
CHARSXPs to R, It forces me to allocate CHARSXPs and copy the entire data
to the R process. By contrast, for the other ALTREP types, say altreal, I
can just return the pointer to R if the data is in the memory.
The same problem occurs for Elt_method as well but is less serious since
only one CHARSXPs is al...
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
to protect a CHARSXP?
Thanks!
Holger
[[alternative
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)
nchar(with(list(2),ls())) gives an internal error. This is of course
a peculiar call (no names in the list), but the error is not caught
cleanly.
It is not clear from the documentation whether with(list(2)...) is
allowable; if 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())
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
2017 Aug 23
2
Error "translateCharUTF8' must be called on a CHARSXP Execution halted"
Dear list,
I installed R 3.3.2 on a Red Hat Linux Enterprise 7.3 machine by adding the EPEL-repository and then installing it via yum.
R starts up and seems 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
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
...es we return a vector of pure
>>> data
>>> in memory allocated outside of R, but for the string, we return a vector
>>> of
>>> R objects allocated by R.
>>>
>>> 2. It causes an unnecessary duplication of the data. In order to return
>>> CHARSXPs to R, It forces me to allocate CHARSXPs and copy the entire data
>>> to the R process. By contrast, for the other ALTREP types, say altreal, I
>>> can just return the pointer to R if the data is in the memory.
>>>
>>> The same problem occurs for Elt_method as wel...
2017 Aug 23
0
Error "translateCharUTF8' must be called on a CHARSXP Execution halted"
On 23.08.2017 12:02, Braun, Stefan wrote:
> Dear list,
>
> I installed R 3.3.2 on a Red Hat Linux Enterprise 7.3 machine by adding the EPEL-repository and then installing it via yum.
> R starts up and seems to be doing fine at first sight. However, when I try to list the files in a directory with the command
>
> files <-
2011 Dec 20
1
RODBC Error: 'getCharCE' must be called on a CHARSXP
I am trying to connect to an internal database and use the sqlQuery command to reduce and retrieve data using the following code:
channel <-odbcConnect("some_dsn", uid="", pwd="")
txt<-'SELECT Date, Region, Price FROM TableXYZ WHERE Type="Domestic"'
sqlQuery(channel, cat(txt,"\n"),errors=TRUE,)
close(channel)
However, I get the
2020 Jul 22
0
Invisible names problem
Very interesting:
> .Internal(inspect(k[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]
2019 May 09
0
ALTREP: Design concept of alternative string
...tent 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 allocated by R.
>
> 2. It causes an unnecessary duplication of the data. In order to return
> CHARSXPs to R, It forces me to allocate CHARSXPs and copy the entire data
> to the R process. By contrast, for the other ALTREP types, say altreal, I
> can just return the pointer to R if the data is in the memory.
>
> The same problem occurs for Elt_method as well but is less serious since
>...
2019 Jul 17
2
ALTREP wrappers and factors
Hello,
I?m experimenting with ALTREP and was wondering if there is a preferred way to create an ALTREP wrapper vector without using .Internal(wrap_meta(?)), which R CMD check doesn?t like since it uses an .Internal() function.
I was trying to create a factor that used an ALTREP integer, but attempting to set the class and levels attributes always ended up duplicating and materializing the
2011 Feb 01
1
list.files() error message: 'translateCharUTF8' must be called on a CHARSXP
I'm using list.files() on my home directory, like this:
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
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
2019 Jul 19
2
ALTREP wrappers and factors
Hi Jiefei and Kylie,
Great to see people engaging with the ALTREP framework and identifying
places we may need more tooling. Comments inline.
On Thu, Jul 18, 2019 at 12:22 PM King Jiefei <szwjf08 at gmail.com> wrote:
>
> If that is the case and you are 100% sure the reference number should be 1
> for your variable *y*, my solution is to call *SET_NAMED *in C++ to reset
> the
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
Hello,
As this little program illustrates, duplicating a STRSXP does not seem
deep enough.
require( inline )
fx <- cfunction( signature( x = "character"), '
SEXP y = PROTECT( duplicate( x ) );
int n = LENGTH(x);
int nc = 0 ;
char* p = 0 ;
for( int i=0; i<n; i++){
p = (char*)( CHAR( STRING_ELT( y , i ) ) );
nc = strlen( p ) ;
for( int j=0; j<nc; j++){
p[j] =