From f65ad0c8777988560d57cc61125d808f8fc8b45c Mon Sep 17 00:00:00 2001 From: Francois Pelletier Date: Mon, 13 Oct 2014 12:10:37 -0400 Subject: [PATCH] package multicore -> package parallel --- .gitignore | 1 + DESCRIPTION | 2 +- FourierStuff.Rproj | 17 +++++++++++++++++ R/cftocdf.R | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 FourierStuff.Rproj diff --git a/.gitignore b/.gitignore index a0fd3b3..6c38bf7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ # Example code in package build process *-Ex.R +.Rproj.user diff --git a/DESCRIPTION b/DESCRIPTION index 6683f12..3ec6f2a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,6 +7,6 @@ Maintainer: Francois Pelletier Description: This is a package gathering different functions to work with the characteristic function and Fourier transforms Depends: - actuar,MASS,multicore + actuar,MASS,parallel LazyLoad: yes License: LGPL-3 diff --git a/FourierStuff.Rproj b/FourierStuff.Rproj new file mode 100644 index 0000000..21a4da0 --- /dev/null +++ b/FourierStuff.Rproj @@ -0,0 +1,17 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source diff --git a/R/cftocdf.R b/R/cftocdf.R index 92607f3..b0d1917 100644 --- a/R/cftocdf.R +++ b/R/cftocdf.R @@ -24,7 +24,7 @@ cftocdf <- function(grid,char.fun,...,wmin=0,wmax=50,MSwindows=FALSE) # Integrate for each grid point using parallel computation if available if(!MSwindows) { - return(unlist(multicore::mclapply(grid, + return(unlist(mclapply(grid, function(x) 1/2-1/pi* integrate(integrand,wmin,wmax,x,char.fun,...)$value))) }