similar to: C code generators

Displaying 20 results from an estimated 10000 matches similar to: "C code generators"

2008 Nov 05
2
Calling optim and .C
Hi all, I want to optimize a function fn using optim. This function fn calls the .C function in it with a function name and arguments given to fn, i.e. something like this pseudocode: fn <- function(par, "some params for fn") {... .C("Cfunction", ...) ...} optim(par, fn, "some params for fn") In my case this doesn't work, but is it possible in general and I
2008 Feb 12
4
assigning NULLs to elements of a list
Dear developers: I have just came across an (unexpected to me) behaviour of lists when assigning NULLs to list elements. I understand that a NULL is a valid R object, thus assigning a NULL to a list element should yield exactly the same result as assigning any other object. So I was surprised when assigning a NULL in fact removed the element from the list. Is this an intended behaviour? If
2007 Oct 05
1
Sklyar's inline package: how to return a list?
Hi, Below I have a mickey-mouse example using Oleg Sklyar's wonderful inline package. The question I have is, how do I return multiple values, say in a list? Inside the C code, I've also calculated 'sum'. How do I return this along with 'res'? Ultimately, I want to return multiple matrix results. Thanks in advance for any code snipplets/advice! Regards, Ken #
2011 Nov 13
1
Myriam Saavedra M. Sc. Questions about maximun radius distance
Dear Mr. Baddeley   I just graduated from a Masters in Applied Mathematics on Jun19th. My thesis was about spatial distribution /a nalysis of some trees in a part of  the Congo Basic Forest. In my thesis I used your spatial package in R, and today I'm doing a more deeper study about how we choise the r distance in Function F(). I would like to be able to understand about value of rmaxdefault
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
2005 Aug 03
2
hash code for arbitrary object
Can anyone suggest a simple way to calculate a 'hash code' from an arbitrary R object? hash(x) should return an integer or string with the property that if hash(x) != hash(y) then x and y are not identical and the time to compute hash(x) should be quite short. Any suggestions welcome thanks Adrian Baddeley
2009 Aug 14
1
Package-level access to Rp->R_Quiet ?
I would like to simulate the effect of the command-line option --quiet from user-level scripts and startup code. From src/main/CommandLineArgs.c I learn that Rp->R_Quiet is set, and I see how that is used in main/main.c. I would use this from code in Rprofile.site. In other words, I want to be silent when --quiet is used (as e.g. by littler or Rscript) but not by R itself in normal
2006 Dec 05
2
intro + specification remarks + some questions
hi everyone, since about 10 days I've been working on an implementation of ogg vorbis *decoder* from scratch, and I've got a few constructive remarks about the specs and some questions. -------------------------- First a question: > 9.2.4. low_neighbor > > "low_neighbor(v,x)" finds the position n in vector [v] of the greatest > value scalar element for which
2004 Dec 03
4
factor matrix
Sorry if this is a FAQ. Is there a good reason why a factor has to be a one-dimensional vector and cannot be a matrix? I want to construct matrices of categorical values. Vain attempts like matrix(factor(c(T,F,F,T), 2,2) yield a matrix of character strings representing the factor levels, not the levels themselves, while factor(matrix(c(T,F,F,T), 2,2)) converts the matrix to a
2014 Jul 30
2
listof
Dear R developers A question about the class 'listof', defined in package 'stats'. Other than its definition and use in the code for 'anova', we can't see that the class 'listof' is used for anything else (in recommended packages, or elsewhere). In the spatstat package we have been using a 'listof' to represent a list of spatial objects of the same
2003 Jun 16
2
extension to plot.formula?
Could I suggest the following extension to plot.formula: plot(cbind(y1,y2) ~ x, ...) should plot (y1 against x) and (y2 against x) on the same plot. The default y axis limits would be determined by the range of c(y1,y2). This would be pretty handy sometimes, replacing 4 lines of code. The current plot.formula evaluates cbind(y1,y2), which is a matrix, so plot.formula looks for
2005 Jun 03
2
dot in formula
gReetings, I want to manipulate a formula object, containing the name "." so that "." is replaced by a desired (arbitrary) expression. What is a safe way to do this? Adrian Baddeley
2005 Jan 27
7
getting package version inside .First.lib
Greetings - Is it possible, inside .First.lib, to find out the version number of the package that is being loaded? If only one version of the package has been installed, we could scan the DESCRIPTION file, something like .First.lib <- function(lib, pkg) { library.dynam("spatstat", pkg, lib) dfile <- system.file("DESCRIPTION", package="spatstat")
2005 Dec 09
1
O-ring statistic
Rainer M Krug writes: > Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004. > Rings, circles and null-models for point pattern analysis in ecology. > Oikos 104: 209-229 a statistic he called O-Ring statistic which is > similar to Ripley's K, only that it uses rings instead of circles. > > http://www.oesa.ufz.de/towi/towi_programita.html#ring
2013 Sep 19
1
Vignette problem and CRAN policies
Hello, All: The vignette with the sos package used "upquote.sty", required for R Journal when it was published in 2009. Current CRAN policy disallows "upquote.sty", and I've so far not found a way to pass "R CMD check" with sos without upquote.sty. I changed sos.Rnw per an email exchange with Prof. Ripley without solving the problem; see below. The
2009 Dec 17
2
segfault in glm.fit (PR#14154)
Bug summary: glm() causes a segfault if the argument 'data' is a data frame with more than 16384 rows. Bug demonstration: -------input --------------- N <- 16400 df <- data.frame(x=runif(N, min=1,max=2),y=rpois(N, 2)) glm(y ~ x, family=poisson, data=df) ------ output --------------- *** caught segfault *** address (nil),
2008 Sep 17
3
Dates in C api
r-devel, I've been trying to write a C plugin for R, and I'm struggling to understand how dates are represented. I can create a date in R: > mydate<-as.Date(1, origin="1900-01-01") mydate [1] "1900-01-02" When I pass my date to a plugin, though, it's type is that of a real. There doesn't seem to be a date type in Rinternals.h, is there a way to
2016 Jul 21
3
Fwd: Problem of array index manipulation collection of LLVM IR
Hi there, I am a newbie of llvm and here is my question situation. Assume that there is a function F which contains a loop named L, a array b[100]. I want to collect the statistical information of array index operation op(i) (take add and mul simply) of i in the loop L. Pseudocode lists below. void F(arg1, arg2){ int b[100]; for(int i=0; i<n; i++){ op1(i); op2(i);
2007 Mar 26
2
sampling from the uniform distribution over a convex hull
Ranjan Maitra writes: > Does anyone have a suggestion (or better still) code for sampling > from the uniform distribution over the convex hull of a set of > points? This is implemented in library 'spatstat'. If x and y are vectors of coordinates of your initial set of points, library(spatstat) W <- convexhull.xy(x, y) P <- runifpoint(42, W) will compute
2003 Aug 06
1
contour lines intersect
Hi, Sorry if this is already known... contour() sometimes draws contour lines that intersect. Is there a temporary fix? A dataset which causes problems is at http://www.maths.uwa.edu.au/~adrian/dumpdata.R If you try just source("dumpdata.R") image(huh) contour(huh) the 100 x 100 matrix 'huh' contains an hourglass-shaped region of values around 0.8. The contour plot