similar to: Sklyar's inline package: how to return a list?

Displaying 20 results from an estimated 700 matches similar to: "Sklyar's inline package: how to return a list?"

2007 May 22
2
inline C/C++ in R: question and suggestion
This is a question and maybe an announcement. We've been discussing in the group that it would be nice to have a mechanism for something like "inline" C/C++ function calls in R. I do not want to reinvent the wheel, therefore, if something like that already exists, please give me a hint -- I could not find anything. If not, here is a working solution, please criticise so I could
2007 Feb 13
2
anyone has C++ STL classes stability issue if used with R
Hello, is there any one who uses C++ STL classes when programming shared libs for R and has had any problems with STL? In the very simple example below I am constantly getting segfaults when trying to populate the queue. The segfault occurs at what looks like a random index in the loop when pushing another element to the queue. Reproduced on 4 machines. Object x is an Image as in EBImage,
2013 Aug 27
1
Error in simulation. NAN
Hi all, im triyng to implement a bayesian model with R and c++. I have a strange problem. I can't reproduce the error with a small script and then i post the original one. The problem is after the line for(MCMC_iter2=0;MCMC_iter2<thin;MCMC_iter2++) For the first 34 iterations all work fine, after, all the simulations of mu_acc_P return an "nan". If i delete the line
2015 Aug 22
0
unset() function?
This wouldn't actually work at present as evaluating a promise always sets NAMED to 2. With reference counting it would work so might be worth considering when we switch. Going forward it would be best to use MAYBE_REFERENCED to test whether a duplicate is needed -- this macro is defined appropriately whether R is compiled to use NAMED or reference counting. Best, luke On Fri, 21 Aug 2015,
2015 Aug 21
3
unset() function?
Does R have a function like the S/S++ unset() function? unset(name) would remove 'name' from the current evaluation frame and return its value. It allowed you to safely avoid some memory copying when calling .C or .Call. E.g., suppose you had C code like #include <R.h> #include <Rinternals.h> SEXP add1(SEXP pX) { int nProtected = 0; int n = Rf_length(pX);
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
Rcpp version 0.7.0 went onto CRAN this weekend. The key new features are o inline support, taken from Oleg Sklyar's neat inline package and adapted/extented to support Rcpp as well as external libraries (see below for an example); this even works on Windows (provided you have Rtools installed and configured); o addition of a new simple type RcppSexp for importing or
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
Rcpp version 0.7.0 went onto CRAN this weekend. The key new features are o inline support, taken from Oleg Sklyar's neat inline package and adapted/extented to support Rcpp as well as external libraries (see below for an example); this even works on Windows (provided you have Rtools installed and configured); o addition of a new simple type RcppSexp for importing or
2015 Feb 05
2
Invalid read of size 8
Hi, I have a R program that call a C function. I define a vector of pointer as int nLC=3; int pownLC = nLC*nLC double *MatCovExtra[nT+1]; for(k=0;k<K+1;k++) { MatCovExtra[k] = (double*)R_alloc(pownLC, sizeof(double)); } where nT>K. Then i put some values on the vector associated with the pointer: for(k=0;k<K+1;k++) { for(i=0;i<nLC;i++)
2012 Dec 06
1
Use .Call interface
Hi I've written the following program: #include <R.h> #include <Rdefines.h> #include "Projector.h" SEXP Projector2(SEXP L, SEXP G, SEXP W, SEXP xymod, SEXP modif){ int nprot=0; PROTECT(L=AS_NUMERIC(L));nprot++; PROTECT(G=AS_NUMERIC(G));nprot++; PROTECT(W=AS_NUMERIC(W));nprot++; PROTECT(xymod=AS_INTEGER(xymod));nprot++; PROTECT(modif=AS_NUMERIC(modif));nprot++;
2006 Dec 02
2
nonlinear quantile regression
Hello, I?m with a problem in using nonlinear quantile regression, the function nlrq. I want to do a quantile regression o nonlinear function in the form a*log(x)-b, the coefficients ?a? and ?b? is my objective. I try to use the command: funx <- function(x,a,b){ res <- a*log(x)-b res } Dat.nlrq <- nlrq(y ~ funx(x, a, b), data=Dat, tau=0.25, trace=TRUE) But a can?t solve de problem,
2007 Dec 10
2
bug in by.data.frame, R-2.6.1 (PR#10506)
by() fails for 1-column matrices and dataframes: X <- data.frame(a=1:10) g <- gl(2,5) by(X, g, colMeans) Suggested fix: --- by-old.R 2007-12-10 15:26:22.501086600 +0100 +++ by.R 2007-12-10 15:25:58.390477200 +0100 @@ -26,7 +26,7 @@ IND[[1]] <- INDICES names(IND) <- deparse(substitute(INDICES))[1] } else IND <- INDICES - FUNx <-
2007 Jan 18
0
[Bug 532] New: ip_nat_sip rewrote Call-ID instead of Contact - patch attached
https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=532 Summary: ip_nat_sip rewrote Call-ID instead of Contact - patch attached Product: netfilter/iptables Version: linux-2.6.x Platform: All URL: http://ibp.de/ OS/Version: All Status: NEW Severity: normal Priority: P2
2010 Sep 13
2
value returned by by()
Hi, I noticed that by() returns an object of class 'by', regardless of what its argument 'simplify' is. ?by says that it always returns a list if simplify=FALSE, yet by.data.frame shows: ---<--------------------cut here---------------start------------------->--- function (data, INDICES, FUN, ..., simplify = TRUE) { if (!is.list(INDICES)) { IND <-
2016 Oct 27
1
PIC and mcmodel=large on x86 doesn't use any relocations
We're at the point in our port of OpenVMS to x86 using LLVM to make choices on mcmodel. Given OpenVMS's history, our linker will allocate static data (ie, .data, .bss, .plt, GOT, etc.) in the bottom 32-bits of address space (ie, 00000000.xxxxxxxx). However, we support code anywhere in the 64-bit address space as PIC code (we do this on Itanium today using our own code-generator and
2008 Apr 15
1
by inconsistently strips class - with fix
summary: The function 'by' inconsistently strips class from the data to which it is applied. quick reason: tapply strips class when simplify is set to TRUE (the default) due to the class stripping behaviour of unlist. quick answer: This can be fixed by invoking tapply with simplify=FALSE, or changing tapply to use do.call(c instead of unlist executable example:
2007 Jan 17
1
smbstatus -B segmentation fault
When using Samba 3.0.23b (slightly old, I know) on CentOS 4.4, smbstatus -B fails with a segmentation fault. smbstatus works, and tdbdump is able to dump brlock.tdb and locking.tdb without any errors (which is not what I expected). Here's the backtrace (non-ASCII characters replaced with 'X'): #0 0x0017fa2c in memcpy () from /lib/tls/libc.so.6 #1 0x0029b19f in tdb_write
2000 Apr 28
0
using by() in a function
I have a fix to by.data.frame() that works for my example. Can anyone see a problem with this? The old code has: > get("by.data.frame",3) function (data, INDICES, FUN, ...) { ### code skipped to save space ans <- eval(substitute(tapply(1:nrow(data), IND, FUNx)), ### The problem seems to be here data) attr(ans, "call") <- match.call() class(ans)
2015 Jan 25
0
Use z size specifier for printf-ing size_t variable
On Sat, Nov 22, 2014 at 10:39 AM, Martin Str|mberg <ams at ludd.ltu.se> wrote: > Hello. > > Use the z size specifier to printf-ing size_t variables to get rid of gcc > warning > format ?%08x? expects type ?unsigned int?, but argument 2 has type ?long unsigned int? Please, add the signed-off line. > > > -- > MartinS > > diff --git
2004 Jun 22
3
[Q] GET_DIM() crash on Windows only
I have the following contrived code in package format. On Solaris and Mac OS X, code runs just fine. On Windows, it crashes the R environment with the "Send Bug Report" dialog. I tried R 1.8.1 (Win2K) and R 1.9 (WinXP) binaries with the same result. PCs otherwise appear properly configured for creating R packages. Anything blatantly wrong? Suggestions? TIA Relevant files from package
2014 Nov 22
3
Use z size specifier for printf-ing size_t variable
Hello. Use the z size specifier to printf-ing size_t variables to get rid of gcc warning format ?%08x? expects type ?unsigned int?, but argument 2 has type ?long unsigned int? -- MartinS diff --git a/com32/lib/syslinux/initramfs_file.c b/com32/lib/syslinux/initramfs_file.c index 7eb55b5..9f9fa75 100644 --- a/com32/lib/syslinux/initramfs_file.c +++ b/com32/lib/syslinux/initramfs_file.c @@