Displaying 20 results from an estimated 1000 matches similar to: "R C api for 'inherits' S3 and S4 objects"
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
2019 Nov 01
0
[External] R C api for 'inherits' S3 and S4 objects
On Fri, 1 Nov 2019, Jan Gorecki wrote:
> Thank you Luke.
> That is why I don't use Rf_inherits but INHERITS which does not
> allocate, provided in the email body.
Your definition can allocate because STING_ELT can allocate.
getAttrib can GC in general. Currently it would not GC or allocate in
this case, but this could change.
You can't assume thread-safety for calls into the R
2019 Nov 01
0
[External] R C api for 'inherits' S3 and S4 objects
On Fri, 1 Nov 2019, Jan Gorecki wrote:
> 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
2009 Mar 17
1
question on "row.names" attribute of dataframe when called from a compiled package
Why does the following show a class attribute of "character" when
using the interpreter:
x <- data.frame(hat=1:10)
class(rownames(x)) ## returns [1] "character"
but when called from c/cpp, the rownames attribute has no class
attribute, and is in fact a vector of INTSXP?
> .Call("print_class_of_rownames", x, package = "test")
length(x): 10
2015 Aug 31
2
R doesn't compile on FreeBSD 10.2
On FreeBSD 10.2, I get the following error when compiling R from the
Subversion trunk (with "configure && make"):
cc -shared -L/usr/local/lib -o tools.so text.o init.o Rmd5.o md5.o signals.o install.o getfmts.o http.o gramLatex.o gramRd.o
mkdir ../../../../library/tools/libs
installing 'sysdata.rda'
Error in dyn.load(file, DLLpath = DLLpath, ...) :
2015 Aug 31
2
R doesn't compile on FreeBSD 10.2
Prof Brian Ripley writes:
> Second, we don't have all the pertinent information such as the
> configure options used and the architecture (x86_64?). I am going to
> have to guess none as none were mentioned, but using --enable-R-shlib
> would be pertinent.
>
> On 31/08/2015 05:47, Davor Cubranic wrote:
>> On FreeBSD 10.2, I get the following error when compiling R
2015 Sep 01
2
R doesn't compile on FreeBSD 10.2
I tried compiling using GCC. First, I changed config.site to:
~/R-3.2.2$ svn diff config.site
Index: config.site
===================================================================
--- config.site (revision 69236)
+++ config.site (working copy)
@@ -278,3 +278,8 @@
## Path to the version of pkg-config to be used for locating cairographics.
## PKGCONF =
+F77=gfortran48
+FC=${F77}
+CC=gcc48
2009 Sep 29
3
How do I access class slots from C?
Hi
I'm trying to implement something similar to the following R snippet using
C. I seem to have hit the wall on accessing class slots using C.
library(fPortfolio)
lppData <- 100 * LPP2005.RET[, 1:6]
ewSpec <- portfolioSpec()
nAssets <- ncol(lppData)
setWeights(ewSpec) <- rep(1/nAssets, times = nAssets)
ewPortfolio <- feasiblePortfolio(
data = lppData,
spec = ewSpec,
2020 Oct 29
2
[External] Something is wrong with the unserialize function
This
Index: src/main/altrep.c
===================================================================
--- src/main/altrep.c (revision 79385)
+++ src/main/altrep.c (working copy)
@@ -275,10 +275,11 @@
SEXP psym = ALTREP_SERIALIZED_CLASS_PKGSYM(info);
SEXP class = LookupClass(csym, psym);
if (class == NULL) {
- SEXP pname = ScalarString(PRINTNAME(psym));
+ SEXP pname =
2009 Aug 25
2
Clarifications please.
Hi
I think I have asked these questions earlier, but I been able to find
answers from the documentation (which I found poorly written in several
places). Will someone be kind enough to give me answers and enlighten me?
(as in explain with CODE?)
I want to embed R in my application and use the fPortfolio package for
carrying out risk management computations. Right now I'm reading the
Rmetrics
2023 Mar 23
1
`dendrapply` Enhancements
Hello Aidan,
Sorry for dropping this for a while.
? Thu, 2 Mar 2023 21:03:59 +0000
"Lakshman, Aidan H" <AHL27 at pitt.edu> ?????:
> //after
> curnode = eval(lang3(R_Bracket2Symbol, parent->node, DEND_IND), env);
lang3() always constructs a new language object. If you do end up using
eval(), it may make sense to move lang3() out of the loop and reuse the
existing object
2014 Jun 25
1
Need help on calling Head from C
Hi ,
I am trying to call head function from C . My doubt is with the parameter
n,how to pass it .
PROTECT(dfm=lang3(install("data.frame"),df,ScalarLogical(FALSE)));
SET_TAG(CDDR(dfm), install("stringsAsFactors")) ;
SEXP res = PROTECT(eval(dfm,R_GlobalEnv));
PROTECT(head=lang3(install("head"),res,ScalarInteger(1)));
head = PROTECT(eval(head,R_GlobalEnv));
I tried
2020 Mar 29
2
is.vector could handle AsIs class better
Dear R-devel,
AsIs class seems to be well handled by `typeof` and `mode` function.
Those two functions are being referred when explaining `is.vector`
behaviour in manual. Yet `is.vector` does not seem to be handling AsIs
class the same way.
is.vector(1L)
#[1] TRUE
is.vector(I(1L))
#[1] FALSE
Is there any reason behind this behaviour?
Could we have it supported so AsIs class is ignored when
2016 Jun 16
3
new function to tools/utils package: dependencies based on DESCRIPTION file
Dear Joris,
So it does looks like the proposed function makes a lot sense then, isn't it?
Cheers,
Jan
On 16 June 2016 at 08:37, Joris Meys <jorismeys at gmail.com> wrote:
> Dear Jan,
>
> It is unavoidable to have OS and R dependencies for devtools. The building
> process for packages is both OS and R dependent, so devtools has to be too
> according to my understanding.
2020 Jun 29
2
R-devel internal errors during check produce?
>>>>> Jan Gorecki writes:
> So the unique.default is from the R tools package during checks.
> I don't see those issues on CRAN checks.
I cannot reproduce this locally (and have no clues about docker).
Perhaps you can try to debug this on your end? And see what env_list is
when the error occurs?
Best
-k
> Exact environment where I am reproducing this issue is a
2016 Jun 14
5
new function to tools/utils package: dependencies based on DESCRIPTION file
Hi all,
Packages tools and utils have a lot of useful stuff for R developers.
I find one task still not as straightforward as it could. Simply to
extract dependencies of a package from DESCRIPTION file (before it is
even installed to library). This would be valuable in automation of CI
setup in a more meta-data driven way.
The simple function below, I know it is short and simple, but having
it to
2020 Mar 30
1
is.vector could handle AsIs class better
Thank you Gabriel,
Agree, although I think that could be relaxed in this single case and
AsIs class could be ignored.
Best,
Jan
On Sun, Mar 29, 2020 at 7:09 PM Gabriel Becker <gabembecker at gmail.com> wrote:
>
> Jan,
>
> I believe it's because it has "a non-NULL attribute other than names" as per the documentation. In this case its class of "AsIs".
>
2020 Jun 26
2
R-devel internal errors during check produce?
Hi R developers,
On R-devel (2020-06-24 r78746) I am getting those two new exceptions
during R check. I found a change which eventually may be related
https://github.com/wch/r-source/commit/69de92b9fb1b7f2a7c8d1394b8d56050881a5465
I think this may be a regression. I grep'ed package manuals and R code
for unique.default but don't see any. Usage section of the unique
method looks fine as
2019 Dec 18
2
head/tail breaking change
Hi R-devel community,
I am aware of changes in R-devel in head/tail methods but I was not
expecting that to be a breaking change.
# R 3.6.1
ar = array(1:27, c(3,3,3))
tail(ar, 1)
#[1] 27
The current output of R-devel is something that I would expect from a
tail(ar, c(1, Inf, Inf))
or
tail(ar, c(1, NA, NA))
calls.
Is it going to stay like this or there are plans to mitigate this
breaking
2009 Oct 29
2
Help with lang4
Hi
I seem to have run into a situation where I have more than 3 arguments to
pass to a function from C.
the following functions help me build an expression for evaluation:
lang
lang2
lang3
lang4
What should one do if there are more arguments than lang4 can handle?
Regards
Abhijit Bera
[[alternative HTML version deleted]]