Re: [R-pkg-devel] Assignments to the global environment and use of on.exit

2021-06-22 Thread Oliver Madsen
The problem is solved by either 1) creating an environment variable within the package namespace (as you would a function) using new.env(). This can then be used instead of the global environment. 2) assigning variables to the namespace of the function running the shiny app. 1) is the second answ

Re: [R-pkg-devel] creating a function that creates a figure

2021-04-27 Thread Oliver Madsen
2 standard options are to either use an example dataset (eg. data(mtcars)) that fits your function. help(glm) has an example using the anorexia dataset. A second option is to create toy data in the example itself. Both help(lm) and help(glm) has examples doing so. Br Oliver P. M. On Wed, 28 Apr 2

Re: [R-pkg-devel] Complex Math Functions in C

2021-02-27 Thread Oliver Madsen
Complex arithmetic seems to be part of "src/main/complex.c" (all of main is not exposed to developers). Rcpp does have quite a bit (if not all?) of the complex math implemented already though, so if you are not set on using C, you could instead work with ComplexVectors in Rcpp (see the online docu

Re: [R-pkg-devel] accessing call constructors in Cpp

2021-01-06 Thread Oliver Madsen
c. > You may have #defined R_NO_REMAP in code that you did not show us. > > -Bill > > On Tue, Jan 5, 2021 at 1:42 PM Oliver Madsen > wrote: > >> This is maybe better suited for Rcpp-devel or another mailing list. If so, >> I apologize. :-) >> >> In

[R-pkg-devel] accessing call constructors in Cpp

2021-01-05 Thread Oliver Madsen
This is maybe better suited for Rcpp-devel or another mailing list. If so, I apologize. :-) In a pet project I've been implementing quite a bit of a package structure within Cpp, including classes to contain and manipulate structures. As a final part of the implementation a user provided R functio