similar to: .Call and data frames

Displaying 20 results from an estimated 1000 matches similar to: ".Call and data frames"

2000 Aug 09
2
GenGC changes
As most R developers maybe are already aware of, R version 1.2.0 introduced a new `generational' garbage collector which means that strings and vectors (and language objects) are handled differently from the numerical atomic types. >From ``Writing R Extensions'': Earlier code was written in a style like. VECTOR(dimnames)[0] = getAttrib(x, R_NamesSymbol);
2009 Jan 05
1
can't get names of R_env
Hi, I'm quite knew in R, so I might not have the R specific jargon. But here is my problem, I'm trying to access and use variabels given by a function environment, more specifically the rho in do_optim in src/main/optim.c According to the documentation http://cran.r-project.org/doc/manuals/R-ints.html#The-_0027data_0027 the envsxp is defined as a tagged pairlist. "ENVSXP: Pointers
2004 Jun 16
1
off topic: C/C++ codes for pseudo inverse
Hi, I am looking for C/C++ codes for computing generalized inverse of a matrix. Can anyone help me in this regard? Thanks, Mahbub.
2019 Nov 01
3
R C api for 'inherits' S3 and S4 objects
Dear R developers, Motivated by discussion about checking inheritance of S3 and S4 objects (in head matrix/array topic) I would light to shed some light on a minor gap about that matter in R C API. Currently we are able to check inheritance for S3 class objects from C in a robust way (no allocation, thread safe). This is unfortunately not possible for S4 classes. I would kindly request new
2003 Dec 17
1
Accessing row and col names of SEXP objects
Can someone lend me a hand with extracting the dimnames from a SEXP? I've looked through R-exts, but I couldn't find an example. Here is the code I'm using to grab the jth column name and print it, but the colnames I'm getting are garbage. None of the following are working. void printInfo(SEXP ts) { int j; for (j=0; j<col; j++) {
2019 Nov 01
4
[External] R C api for 'inherits' S3 and S4 objects
Thank you Luke. That is why I don't use Rf_inherits but INHERITS which does not allocate, provided in the email body. I cannot do similarly for S4 classes, thus asking for some API for that. On Fri, Nov 1, 2019 at 5:56 PM Tierney, Luke <luke-tierney at uiowa.edu> wrote: > > On Fri, 1 Nov 2019, Jan Gorecki wrote: > > > Dear R developers, > > > > Motivated by
2005 Nov 18
1
using a factor as col argument in plot:
Dear R core team Using the following code produces an empty plot (similar to col = NA): > plot(1:9, col = factor(rep(1:3,3), labels = c("red", "blue", "black"))) My question: Shouldn't one get at least a warning (or an error) if one tries to use a factor as col argument? Thanks for an answer. Regards, Christoph Buser
2010 Jun 19
1
more powerful iconv
R community, As you may know, R's iconv doesn't work well converting to and from encodings that allow embedded nulls. For example > iconv("foo", to="UTF-16") Error in iconv("foo", to = "UTF-16") : embedded nul in string: '\xff\xfef\0o\0o\0' However, I don't believe embedded nulls are at issue here, but rather that R's iconv
2000 Sep 07
1
getAttrb - Solved
Hi, I changed INTEGER(getAttrib(shape,mkChar("nParts")))[0] to INTEGER(getAttrib(shape,mkString("nParts")))[0] and now it works fine. Nicholas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the
2002 Mar 02
1
accessing factor levels from C
Hi, I am trying to get information about factors from a C-program. As I see, the factors are basically integers with attribute ,,levels''. But unfortunately I am not been able to read the levels information. I am using: SEXP variable, levels; ... variable = VECTOR_ELT( data_frame, j); switch( TYPEOF( variable)) { case INTSXP: if( isFactor( VECTOR_ELT( data_frame,
2020 Sep 24
1
How to use `[` without evaluating the arguments.
Hello R-devel, I am currently attempting to implement an API similar to data.table wherein single bracket subsetting can accept an unquoted expression to be evaluated in the context of my object. A simple example from the data.table package looks like this: DT <- data.table(col1 = c('a', 'b', 'c'), col2 = c('x', 'y', 'z')) DT[col1 ==
2006 Oct 15
1
Feature request: names(someEnv) same as ls(someEnv)
Hi, I would be nice if names() returned the equivalent of ls() for environments. --- a/src/main/attrib.c +++ b/src/main/attrib.c @@ -687,6 +687,8 @@ SEXP attribute_hidden do_names(SEXP call s = CAR(args); if (isVector(s) || isList(s) || isLanguage(s)) return getAttrib(s, R_NamesSymbol); + if (isEnvironment(s)) + return R_lsInternal(s, 0); return R_NilValue; }
2010 Sep 08
0
Correction to vec-subset speed patch
I found a bug in one of the fourteen speed patches I posted, namely in patch-vec-subset. I've fixed this (I now see one does need to duplicate index vectors sometimes, though one can avoid it most of the time). I also split this patch in two, since it really has two different and independent parts. The patch-vec-subset patch now has only some straightforward (locally-checkable) speedups for
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
I'd like to propose a change to the R language so that calling 'parent.env<-' on a package namespace or package imports is a runtime error. Currently the documentation warns that it's dangerous behaviour and might go away: The replacement function ?parent.env<-? is extremely dangerous as it can be used to destructively change environments in ways that violate
2006 Jul 18
2
send a list from R to C
Hello at all ! What is the correct form to give a list form R (e.g. list(c(-1,1), "TestFile") ) to C. I have no problems, if I don't use character and I have also no problems to give a character vector form R to C. But, if I combine real and strings in a list then I don't know the correct syntax. I try it with following (an example): SEXP writeFile(SEXP headerR){ Image
2020 Jun 16
1
[External] numericDeriv alters result of eval in R 4.0.1
Dear all As far as I could trace, looking at the function C function numeric_deriv, this unwanted behavior comes from the inner most loop in, at the very end of the function, for(i = 0, start = 0; i < LENGTH(theta); i++) { for(j = 0; j < LENGTH(VECTOR_ELT(pars, i)); j++, start += LENGTH(ans)) { SEXP ans_del; double origPar, xx, delta; origPar = REAL(VECTOR_ELT(pars, i))[j];
2005 Nov 07
3
R thread safe
Dear R-dev, I would like to accelerate my R computation by using parallel OpenMP compilers (e.g from Pathscale) on a 2-processor AMD server and I would like to know whether R is a tread safe library. The main kernel of the OpenMP parallelization is a C SEXP function that performs the computational routine in parallel with: ******************* SEXP example(SEXP list, SEXP expr, SEXP rho) {
2011 Mar 18
1
[Patch suggestion] Adding 3rd arg to tempfile() to set extension
The other day I was working on an example which used tempfile() to create file for use by the graphics device. And while I love tempfile()---as it is portable and clever and the files get cleaned by R and all that---I noticed one missing feature I would like to see: beside a starting name pattern, and an optional directory, an 'file extension' argument would be nice to have. As e.g. in
2017 Jun 08
1
DESeq2 pairwise compasion
There are two line 216 and 218 Three development stages 5 WEEK (5W), 7W, 9W. Three tissue: Ca, Co, Pa each with 2 biological replicate. With two biological replicate. I want to do differential gene expression analysis using DESeq2 so I tried these codes after reading about DESeq2: ,my aim is to do the pairwise comparison. how to make colData and design formula. library("DESeq2")
2005 Jan 24
4
converting R objects to C types in .Call
Dear People, I'm trying to write an R wrapper for a C++ library, using .Call. I've never used .Call before. I'm currently having some difficulties converting a R character string to a C one. Here is a little test program. #include <R.h> #include <Rinternals.h> #include <stdio.h> SEXP testfn(SEXP chstr) { char * charptr = CHAR(chstr); printf("%s",