similar to: how to call a function from C

Displaying 20 results from an estimated 200 matches similar to: "how to call a function from C"

2014 Mar 05
1
[PATCH] Code coverage support proof of concept
Hello, I submit a patch for review that implements code coverage tracing in the R interpreter. It records the lines that are actually executed and their associated frequency for which srcref information is available. I perfectly understands that this patch will not make its way inside R as it is, that they are many concerns of stability, compatibility, maintenance and so on. I would like to have
2010 Jan 24
1
header files for R packages
I have 6 or 7 nice constants (for example 1852 meters per nautical mile) I would like to have available to 4 or 5 functions in an R package. In C this would just be a header .h file and I would just "include" I am stuck trying to figure out how to create something like a C header file for an R package. Any ideas?
2010 Jan 14
1
Logical function
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100114/da4bc580/attachment.pl>
2010 Jan 19
2
Working with text data/text operators
Hello, Could someone tell me, how can I select from a dataframe only those columns whose names contain a certain text? For example, if the column names are "Bond1.Creditclass","Bond1.Price","Bond2.Creditclass","Bond2.Price", how do I select only the columns corresponding to Bond1? Thanks a lot, Mihai [[alternative HTML version deleted]]
2010 Feb 01
1
Number with fixed digit length - zero fill-up
Dear R-help members, I'm quite new to R and I apologize for my basic question, but I haven't been able to find a solution yet. I try to interpret vector entries as a binary code, but unfortunately every first digit which is zero disappears. So how can I set any number (e.g. x = 10110) to a 8-digit zero fill-up (x = 00010110) in order to address digit indices? Or other way round, how
2010 Jan 26
4
Error with toString
Hello there, I want to create a string from strings and numbers, here is my code: str <- "name" & toString(20) but it returns me this error: Error in toString(20) : could not find function ".jcall" what did I do wrong? I couldn't find this error anywhere... -- View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1290327.html Sent from
2010 Jan 26
4
reading a string vector
Hi, I need to read a string vector in R which is like this "atgctaaaactaatcgtcccaacaattatattactaccac", but R seems to understand it as a unique vector input when I read in like x <- "atgctaaaactaatcgtcccaacaattatattactaccac". How do I unconcatenate it, so I can use each of the letters on my reading? Thanks, Beatriz -- View this message in context:
2010 Jan 23
1
matrix to a C function
Hi the list, Is there a way to give a matrix to a C function, and then to use it as a matrix ? I write a function to print a matrix, but I use it as a vector : 1. void printMatrix(double *mTraj,int *nbCol, int *nbLigne){ 2. int i=0,j=0; 3. for(i=0 ; i < *nbLigne ; i++){ 4. for(j=0 ; j < *nbCol ; j++){ 5. Rprintf(" %f",mTraj[i * *nbCol + j]); 6. } 7.
2010 Jan 22
2
Optimizing C code
Hi the list, I need to write some efficient distances function, so I read the code for the Euclidean distance. I do not understand the purpose of the line 11 : if x[i] and y[i] are not NA (line 9), can dev be NA ? Christophe #define both_FINITE(a,b) (R_FINITE(a) && R_FINITE(b)) #define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b)) 1. static double R_euclidean2(double *x, double
2010 Jan 22
2
R CMD check error with the GNU Scientific Library
I have been working on an R package that calls C code using .C(). I recently started including some functions from the GNU Scientific Library in my code. The code runs fine on my machine when not wrapped in the package. But I get the following error from "R CMD check" * checking whether the package can be loaded ... ERROR Loading required package: splancs Loading required package: sp
2010 Jan 14
5
Better way than an ifelse statement?
Hello All, I am trying to create a column of weights based off of factor levels from another column. I am using the weights to calculate L scores. Here is an example where the first column are scores, the second is my "factor" and the third I want to be a column of weights. I can do what I want with an ifelse statement (see below), but I am wondering if anyone knows of a cleaner way
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
The patch below adds support for custom HTTP headers in download.file() and url(). My main motivation for this is performing basic http authentication. Some web sites do not support embedding the credentials into the URI itself, they only work if the username and password are sent in the HTTP headers. In fact specifying the username and password in the URI has been
2010 Jan 09
1
Is nested namespace supported?
Could somebody let me know if there is nested name space supported? For example, is it possible to define a function in the name space 'nested_namespace' which is nested in the name space 'some_namespace'? some_namespace:::nested_namespace:::a_function() I checked Section 1.6 of R-exts.pdf. It seems that nested namespace is not supported, right?
2010 Feb 08
5
Fast way to determine number of lines in a file
Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley -- http://had.co.nz/
2010 Feb 11
2
LinkingTo and C++
Hello, I've been trying to make LinkingTo work when the package linked to has c++ code. I've put dumb packages to illustrate this emails here ; http://addictedtor.free.fr/misc/linkingto Package A defines this C++ class: class A { public: A() ; ~A() ; SEXP hello() ; } ; Package B has this function : SEXP say_hello(){ A a ; return a.hello() ; } headers of package A are copied
2014 Feb 26
1
help with gotoExitingHandler(R_NilValue, call, entry); . Implementation of error handling internally
Hello, I?m trying to leverage R_ToplevelExec to implement C level try/catch. The way it is implemented allows for running a function in a top level context. This context gets an empty handler stack, so either the function runs correctly or it jumps. When it jumps, it does not find a handler, so it jumps to the top level context. R does not allow me to call begin context and end context
2004 Jul 06
1
Wrong object type produced - LANGSXP should be LISTSXP (PR#7055)
Full_Name: David Bauer Version: 1.9 OS: Linux Submission from: (NULL) (160.91.245.8) In the file gram.y, the xxsubscript function generates a LANGSXP with another LANGSXP as its CDR. I believe that this is a mistake and that the second LANGSXP should be a LISTSXP. The inputs a1, a3 are parameters to the subscript function (a2), and as such they should be in a dotted-pair list. David Bauer
2017 Jun 27
2
paste strings in C
Dear R-devs, Below is a small example of what I am trying to achieve, that is trivial in R and I would like to learn how to do in C, for very large matrices: > (mymat <- matrix(c(1,0,0,2,2,1), nrow = 2)) [,1] [,2] [,3] [1,] 1 0 2 [2,] 0 2 1 And I would like to produce: [1] "a*C" "B*c" Which can be trivially done in R via something like: foo
2024 Apr 14
1
Calling applyClosure from a package?
Hi, Short version of my question: Rf_applyClosure was marked attribute_hidden in Oct 2023, and I am curious why and if there is an alternative interface to it planned. Long version: I have been toying with building a package that makes it easier to do non-standard evaluation directly using promises, rather than wrapping these in a custom type (like e.g. rlang does). The advantage of this
2017 Jun 27
0
paste strings in C
To do this in C, it would probably be easier and faster to just do the string manipulation directly. Luckily, there are already packages that have done this for you. See an example below using the S4Vectors package. foo2 <- function(mymat, colnms, tilde=FALSE) { chars <- colnms[col(mymat)] lowerChars <- if (tilde) paste0("~", chars) else tolower(chars) chars <-