search for: cfuns

Displaying 20 results from an estimated 20 matches for "cfuns".

Did you mean: cfunc
2018 Oct 16
2
invisible functions
The survival package, like many others, has several helper functions that are not declared in the namespace, since their only use is to be called by other "main" functions of the package.? This works well since the functions in the survival namespace can see them --- without ::: arguments --- and others don't. Until a situation I ran into this week, for which I solicit comments
2018 Oct 16
0
invisible functions
On 16/10/2018 6:42 PM, Therneau, Terry M., Ph.D. via R-devel wrote: > The survival package, like many others, has several helper functions that are not declared > in the namespace, since their only use is to be called by other "main" functions of the > package.? This works well since the functions in the survival namespace can see them --- > without ::: arguments --- and
2015 Jun 03
2
Problem with shared library and lapack under windows
Hi all, I have a C function, say Cfun, that calls Lapack's DGEMM routine and I need to create a shared library to use Cfun inside R. The C file is the following #include<stdio.h> #include<R.h> #include<R_ext/Lapack.h> void Cfun(double *res, double *X, int *n, int *q) { char *ptr_TRANSA, TRANSA='T', *ptr_TRANSB, TRANSB='N'; ptr_TRANSA=&TRANSA;
2017 Mar 31
2
How to write the same things as `opt` command in C++ API
Hi, I'm Ryo Ota. I'm using LLVM 3.8.1. I have a quesion about inlining function in C++ API. I'd like to inline some functions in a module in the same way as `opt -inline` command. But my C++ code didn't work what I want to do. For example, by using `opt -inline` command,`main.ll` is converted into the `inlined.ll`(`opt` command worked what I want to do) [main.ll (Not inlined)]
2018 Oct 17
1
invisible functions
> 2. change cfun[[1]] <- quote(cord.work) to cfun[[1]] <- > quote(survival:::cord.work). You say this will mess up your test bed. > That suggests that your test bed is broken. This is a perfectly legal > and valid solution. Valid in a package, but forces code to call a loaded library version of a function rather than (say) a 'source'd user-space version that is under
2007 Oct 12
3
collapsing a data frame
...e might want to specify more than one summary function, or specify that factors that vary within group should be dropped.) vtype = sapply(h,class) ## variable types [numeric or factor] vtypes = unique(vtype) ## possible types v2 = lapply(vtypes,function(z) which(vtype==z)) ## which are which? cfuns = list(factor=function(z)z[1],numeric=mean)## functions to apply m = mapply(function(w,f) { aggregate(h[w],list(h$BROOD),f) }, v2,cfuns,SIMPLIFY=FALSE) data.frame(m[[1]],m[[2]][-1]) My question is whether this is re-inventing the wheel. Is there some function or package that performs this tas...
2017 Jun 14
2
[WISH / PATCH] possibility to split string literals across multiple lines
Mark, that's actually a fair statement, although your extra operator doesn't cause construction at parse time. You still call paste0(), but just add an extra layer on top of it. I also doubt that even in gigantic loops the benefit is going to be significant. Take following example: atestfun <- function(x){ y <- paste0("a very long", "string for
2019 Nov 04
2
Questions on the R C API
Hi All, I have some questions regarding the R C API. Let's assume I have a function which is defined as follows: R file: myfunc <- function(a, b, ...) .External(Cfun, a, b, ...) C file: SEXP Cfun(SEXP args) { args = CDR(args); SEXP a = CAR(args); args = CDR(args); SEXP b = CAR(args); args = CDR(args); /* continue to do something with remaining arguments in "..."
2009 Feb 24
3
All the products of common factors
This is a seemingly simple problem - hopefully someone can help. Problem: we have two integers. We want (1) all the common factors, and (2) all the possible products of these factors. We know how to get (1), but can't figure out a general way to get (2). Example: 40 and 80 have these factors: c(1,2,2,2,5) and c(1,2,2,2,2,5). We can use match() to get the common factors c(1,2,2,2,5). What
2019 Nov 05
1
Questions on the R C API
Thank you for your reply Jiefei. I think in theory your solution should work. I'll have to give them a try. On Mon, 4 Nov 2019 23:41 Wang Jiefei, <szwjf08 at gmail.com> wrote: > Hi Morgan, > > My solutions might not be the best one(I believe it's not), but it should > work for your question. > > 1. Have you considered Rf_duplicate function? If you want to change
2013 Apr 09
1
Solving an integral in R gives the error “The integral is probably divergent”
I am trying to solve an integral in R. However, I am getting an error when I am trying to solve for that integral. The equation that I am trying to solve is as follows: $$ C_m = \frac{{abs{x}}e^{2x}}{\pi^{1/2}}\int_0^t t^{-3/2}e^{-x^2/t-t}dt $$ [image: enter image description here] The code that I am using is as follows: a <- seq(from=-10, by=0.5,length=100) ## Create a function to compute
2017 Jun 14
0
[WISH / PATCH] possibility to split string literals across multiple lines
I know it doesn't cause construction at parse time, and it was also not what I said. What I meant was that it makes the syntax at least look a little as if you have a line-breaking character within string literals. Op wo 14 jun. 2017 om 14:18 schreef Joris Meys <jorismeys at gmail.com>: > Mark, that's actually a fair statement, although your extra operator > doesn't cause
2019 Nov 04
0
Questions on the R C API
Hi Morgan, My solutions might not be the best one(I believe it's not), but it should work for your question. 1. Have you considered Rf_duplicate function? If you want to change the value of `a` and reset it later, you have to have a duplication somewhere for resetting it. Instead of changing the value of `a` directly, why not changing the value of a duplicated `a`? So you do not have to
2001 Oct 11
2
large dataframes to ascii
Hi R-users, I want to convert a large dataset (from stata format) to an ascii table. The resulting table should be a human-readable table (like CSV, or tab-separated file or something similar). R reads the stata-file quite easily (with some problems which are discussed here earlier), but so long I have not found a suitable way to write it in ascii format. Sure, there exists write.table, which
2012 May 11
0
[patch] Behavior of .C() and .Fortran() when given double(0) or integer(0) (repost).
Dear R-devel, Duncan Murdoch suggested that I repost this if I don't get a response in a week, so here it is. The tests and the patches were on/against revision 59314, but I don't think that any of the commits since then affected the code in question. While tracking down some hard-to-reproduce bugs in a package I maintain, I stumbled on a behavior change between R 2.15.0 and the current
2017 Jun 14
4
[WISH / PATCH] possibility to split string literals across multiple lines
On Wed, 14 Jun 2017 06:12:09 -0500, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > On 14/06/2017 5:58 AM, Andreas Kersting wrote: > > Hi, > > > > I would really like to have a way to split long string literals across > > multiple lines in R. > > I don't understand why you require the string to be a literal. Why not > construct the long
2011 Sep 20
0
Using method = "aic" with pspline & survreg (survival library)
Hi everybody. I'm trying to fit a weibull survival model with a spline basis for the predictor, using the survival library. I've noticed that it doesn't seem to be possible to use the aic method to choose the degrees of freedom for the spline basis in a parametric regression (although it's fine with the cox model, or if the degrees of freedom are specified directly by the user),
2009 Jul 02
3
[LLVMdev] LLVM under Syllable
I tried to Build LLVM under Syllable, but it was failed on the next moment http://clip2net.com/clip/m0/1246547164-clip-99kb.png any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090702/346df366/attachment.html>
1997 May 29
2
R-beta: WISH: For dyn.load()ing, I'd like is.loaded(.) , symbol.C, symbol.For
In S(plus), I can write functions using code fragments like if(!is.loaded(symbol.C("my_C_fun"))) dyn.load("......../my_C_fun.o") r <- .C("my_C_fun", x = x, n = n, ... ) which I would like to have in R, too. The S-plus help page on this subject says : S+>> Code Availability S+>> S+>> DESCRIPTION: S+>> is.loaded
2012 May 04
4
[patch] Behavior of .C() and .Fortran() when given double(0) or integer(0).
Dear R-devel, While tracking down some hard-to-reproduce bugs in a package I maintain, I stumbled on a behavior change between R 2.15.0 and the current R-devel (or SVN trunk). In 2.15.0 and earlier, if you passed an 0-length vector of the right mode (e.g., double(0) or integer(0)) as one of the arguments in a .C() call with DUP=TRUE (the default), the C routine would be passed NULL (the C