Skip to content

Commit

Permalink
solved problems with NANs
Browse files Browse the repository at this point in the history
  • Loading branch information
sestelo committed Oct 30, 2017
1 parent a57bfa5 commit 4a186f5
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
^.*\.Rproj$
^\.Rproj\.user$
.travis.yml
.lsq.mod
4 changes: 0 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ importFrom(stats,runif)
importFrom(stats,terms.formula)
importFrom(utils,combn)
importFrom(wesanderson,wes_palettes)
useDynLib(npregfast, .registration = TRUE)
useDynLib(npregfast,allotest_)
useDynLib(npregfast,frfast_)
useDynLib(npregfast,globaltest_)
useDynLib(npregfast,localtest_)
4 changes: 2 additions & 2 deletions R/allotest.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
#'@examples
#' library(npregfast)
#' data(barnacle)
#' allotest(DW ~ RC, data = barnacle, nboot = 50, seed = 130853)
#' allotest(DW ~ RC, data = barnacle, nboot = 50, seed = 130853, cluster = FALSE)
#'
#' @useDynLib npregfast allotest_
#' @importFrom stats na.omit runif
#' @export


# @useDynLib npregfast allotest_



Expand Down
2 changes: 0 additions & 2 deletions R/frfast.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@
#' # fit4 <- frfast(DW ~ RC : F, data = barnacle, model = "allo", nboot = 100)
#' # summary(fit4)
#'
#' @useDynLib npregfast, .registration = TRUE
#' @useDynLib npregfast frfast_
#' @importFrom stats na.omit runif lm predict quantile
#' @importFrom mgcv interpret.gam gam predict.gam
#' @importFrom sfsmisc D1D2
Expand Down
1 change: 0 additions & 1 deletion R/globaltest.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
#' # seed = 130853, der = 0, smooth = "splines")
#'
#'
#' @useDynLib npregfast globaltest_
#' @importFrom stats na.omit runif
#' @importFrom mgcv interpret.gam gam predict.gam
#' @importFrom sfsmisc D1D2
Expand Down
1 change: 0 additions & 1 deletion R/localtest.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
#' # localtest(height ~ s(age, by = sex), data = children, seed = 130853,
#' # der = 1, smooth = "splines")
#'
#' @useDynLib npregfast localtest_
#' @importFrom stats na.omit runif
#' @importFrom mgcv interpret.gam gam predict.gam
#' @importFrom sfsmisc D1D2
Expand Down
25 changes: 25 additions & 0 deletions src/npregfast_init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <R_ext/RS.h>
#include <stdlib.h> // for NULL
#include <R_ext/Rdynload.h>

/* FIXME:
Check these declarations against the C/Fortran source code.
*/

/* .Fortran calls */
extern void F77_NAME(frfast_)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
extern void F77_NAME(globaltest_)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
extern void F77_NAME(localtest_)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);

static const R_FortranMethodDef FortranEntries[] = {
{"frfast_", (DL_FUNC) &F77_NAME(frfast_), 43},
{"globaltest_", (DL_FUNC) &F77_NAME(globaltest_), 18},
{"localtest_", (DL_FUNC) &F77_NAME(localtest_), 23},
{NULL, NULL, 0}
};

void R_init_npregfast(DllInfo *dll)
{
R_registerRoutines(dll, NULL, NULL, FortranEntries, NULL);
R_useDynamicSymbols(dll, FALSE);
}
Binary file added src/npregfast_init.o
Binary file not shown.
Binary file added src/symbols.rds
Binary file not shown.

0 comments on commit 4a186f5

Please sign in to comment.