FPEMglobal is an R package for producing estimates and projections of contraceptive use and unmet need for family planning among married, unmarried, and all women.
This package was developed by the Family Planning Research (FPR) Group which is comprised of teams from the Alkema Lab at the University of Massachusetts, Amherst, the Population Division of the United Nations Dept. of Economic and Social Affairs, and Track20 at Avenir Health. It was supported, in part, by grants nos. OPP1110679 and OPP1183453, Making Family Planning Count 1.0--2.0, from the Bill & Melinda Gates Foundation. The package vignette has more information (vignette("FPEMglobal_Intro").
Disclaimer: The views expressed herein are those of the authors and do not necessarily reflect the views of the United Nations.
Ensure you have installed both R and JAGS. FPEMglobal has been tested with R v4.0.0--v.4.4.0 (64 bit) and JAGS v4.3.0--v4.3.1.
Follow one of the following three options:
-
Make sure you have installed the R package remotes.
-
In R, type:
remotes::install_github(repo = "https://github.com/FPcounts/FPEMglobal", ref = remotes::github_release(), build_manual = TRUE, build_vignettes = TRUE, dependencies = TRUE)
repois the only mandatory argument. If you encounter any problems you can try omitting any, or all, of the others. If you do not supply therefargument, or if you change it, you may end up installing an old release or one that is in development and not fully tested. -
It is highly recommended that you install the "doParallel" or "doMC" packages (the latter is not available on Windows). These are available on CRAN and can be installed from within R by typing:
install.packages("doParallel")
-
Go to the release page
-
Download the .tar.gz file or, (Windows only) the .zip file, corresponding to the latest release (the one at the top of the list). It will have a filename of the form "FPEMglobal_x.y.z.tar.gz" or "FPEMglobal_x.y.z.zip" where "x.y.z" are numbers indicating the version. If the file is not visible, click "Assets".
-
Install the package: launch R and type:
install.packages("[path/to/FPEMglobal_<x.y.z>.<tar.gz/zip>]", repos = NULL)
You will need to edit the first argument to ensure you enter the correct file path to the tar.gz or zip file.
<x.y.z>should be replaced by the actual version number;<tar.gz/zip>should be replaced by the actual file extension. You will also need to install any package depencencies according to the notices that come up.
You will need to have basic knowledge of Git, GitHub, and the command line interface on your system to use this option.
-
Clone the repository to your local drive.
-
Open a terminal or command prompt window in the directory containing the cloned repository (the directory containing the directory "FPEMglobal").
-
Issue the following commands:
R CMD build FPEMglobal R CMD INSTALL FPEMglobal_<x.y.z>.tar.gzIn the last command,
<x.y.z>should be replaced by the actual version number.If you get errors related to the vignette, try modifying the first command as follows:
R CMD build --no-build-vignettes FPEMglobal. If you are on Windows and you get an error after a line of output containing "i386" , try modifying the second command as follows:R CMD INSTALL --no-multiarch FPEMglobal_<x.y.z>.tar.gz(replacing<x.y.z>accordingly). If you still have problems, follow the instructions above to install from the zip file.
The vignette "Introduction to FPEMglobal" explains the package and how to use it. From within R type:
vignette("FPEMglobal_Intro")The vignette will not be available if you excluded it by omitting the build_vignettes argument in installation option (1) or adding --no-build-vignettes in option (3).